/
IProcessDumpUtility.cs
67 lines (62 loc) · 2.5 KB
/
IProcessDumpUtility.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.TestPlatform.Extensions.BlameDataCollector
{
using System;
using System.Collections.Generic;
public interface IProcessDumpUtility
{
/// <summary>
/// Get generated dump files
/// </summary>
/// <param name="warnOnNoDumpFiles">Writes warning when no dump file is found.</param>
/// <returns>
/// Path of dump file
/// </returns>
IEnumerable<string> GetDumpFiles(bool warnOnNoDumpFiles = true);
/// <summary>
/// Launch proc dump process
/// </summary>
/// <param name="processId">
/// Process ID of test host
/// </param>
/// <param name="testResultsDirectory">
/// Path to TestResults directory
/// </param>
/// <param name="isFullDump">
/// Is full dump enabled
/// </param>
/// <param name="targetFramework">
/// The target framework of the process
/// </param>
void StartTriggerBasedProcessDump(int processId, string testResultsDirectory, bool isFullDump, string targetFramework);
/// <summary>
/// Launch proc dump process to capture dump in case of a testhost hang and wait for it to exit
/// </summary>
/// <param name="processId">
/// Process ID of test host
/// </param>
/// <param name="testResultsDirectory">
/// Path to TestResults directory
/// </param>
/// <param name="isFullDump">
/// Is full dump enabled
/// </param>
/// <param name="targetFramework">
/// The target framework of the process
/// </param>
/// <param name="logWarning">
/// Callback to datacollector logger to log warning
/// </param>
void StartHangBasedProcessDump(int processId, string testResultsDirectory, bool isFullDump, string targetFramework, Action<string> logWarning = null);
/// <summary>
/// Detaches the proc dump process from the target process
/// Ensure this is called before terminating the proc dump process
/// as it might lead to the testhost process crashing otherwise.
/// </summary>
/// <param name="targetProcessId">
/// Process Id of the process to detach from
/// </param>
void DetachFromTargetProcess(int targetProcessId);
}
}