summaryrefslogtreecommitdiff
path: root/src/pal/src/include/pal/perftrace.h
blob: fec46e23306fae56934866e0f137188962bc5af5 (plain)
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
68
69
70
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

/*++



Module Name:

    include/pal/perftrace.h

Abstract:
    Header file for PAL Performance trace utilities.



--*/

/*
Overview of PAL Performance utilities
  
 */

#ifndef _PAL_PERFTRACE_H_
#define _PAL_PERFTRACE_H_

#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus

#if PAL_PERF
#define PERF_ENTRY(x)  \
	ULONGLONG pal_perf_start_tick = 0;\
    PERFLogFunctionEntry( PAL_PERF_##x, &pal_perf_start_tick )
#define PERF_EXIT(x) \
	PERFLogFunctionExit( PAL_PERF_##x, &pal_perf_start_tick ) 
#define PERF_ENTRY_ONLY(x)  \
	PERFNoLatencyProfileEntry( PAL_PERF_##x )

BOOL PERFInitialize(LPWSTR command_line, LPWSTR exe_path) ;
void PERFTerminate( );
BOOL PERFAllocThreadInfo( ); 
void PERFLogFunctionExit(unsigned int pal_api_id, ULONGLONG *pal_perf_start_tick);
void PERFLogFunctionEntry(unsigned int pal_api_id, ULONGLONG *pal_perf_start_tick);
void PERFEnableThreadProfile(BOOL isInternal);
void PERFDisableThreadProfile(BOOL isInternal);
void PERFEnableProcessProfile( );  
void PERFDisableProcessProfile( ); 
BOOL PERFIsProcessProfileEnabled( );
void PERFNoLatencyProfileEntry(unsigned int pal_api_id );
void PERFCalibrate(const char* msg);

#else  /* PAL_PERF */

#define PERF_ENTRY(x) 
#define PERF_ENTRY_ONLY(x) 
#define PERF_EXIT(x)  

#endif /* PAL_PERF */

#ifdef __cplusplus
}
#endif // __cplusplus

#endif /* _PAL_PERFTRACE_H_ */