-
Notifications
You must be signed in to change notification settings - Fork 240
/
gumprofiler.h
56 lines (43 loc) · 2.01 KB
/
gumprofiler.h
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
/*
* Copyright (C) 2008-2018 Ole André Vadla Ravnås <[email protected]>
* Copyright (C) 2008 Christian Berentsen <[email protected]>
*
* Licence: wxWindows Library Licence, Version 3.1
*/
#ifndef __GUM_PROFILER_H__
#define __GUM_PROFILER_H__
#include "gumprofilereport.h"
#include "gumsampler.h"
#include <gum/guminvocationcontext.h>
G_BEGIN_DECLS
#define GUM_TYPE_PROFILER (gum_profiler_get_type ())
G_DECLARE_FINAL_TYPE (GumProfiler, gum_profiler, GUM, PROFILER, GObject)
typedef enum
{
GUM_INSTRUMENT_OK = 0,
GUM_INSTRUMENT_WRONG_SIGNATURE = -1,
GUM_INSTRUMENT_WAS_INSTRUMENTED = -2
} GumInstrumentReturn;
typedef gboolean (* GumFunctionMatchFilterFunc) (const gchar * function_name,
gpointer user_data);
typedef void (* GumWorstCaseInspectorFunc) (GumInvocationContext * context,
gchar * output_buf, guint output_buf_len, gpointer user_data);
GUM_API GumProfiler * gum_profiler_new (void);
GUM_API void gum_profiler_instrument_functions_matching (GumProfiler * self,
const gchar * match_str, GumSampler * sampler,
GumFunctionMatchFilterFunc filter_func, gpointer user_data);
GUM_API GumInstrumentReturn gum_profiler_instrument_function (
GumProfiler * self, gpointer function_address, GumSampler * sampler);
GUM_API GumInstrumentReturn gum_profiler_instrument_function_with_inspector (
GumProfiler * self, gpointer function_address, GumSampler * sampler,
GumWorstCaseInspectorFunc inspector_func, gpointer user_data);
GUM_API GumProfileReport * gum_profiler_generate_report (GumProfiler * self);
GUM_API guint gum_profiler_get_number_of_threads (GumProfiler * self);
GUM_API GumSample gum_profiler_get_total_duration_of (GumProfiler * self,
guint thread_index, gpointer function_address);
GUM_API GumSample gum_profiler_get_worst_case_duration_of (GumProfiler * self,
guint thread_index, gpointer function_address);
GUM_API const gchar * gum_profiler_get_worst_case_info_of (GumProfiler * self,
guint thread_index, gpointer function_address);
G_END_DECLS
#endif