-
Notifications
You must be signed in to change notification settings - Fork 206
/
rp_call_tree.h
50 lines (39 loc) · 1.78 KB
/
rp_call_tree.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
/* Copyright (C) 2005-2019 Shugo Maeda <shugo@ruby-lang.org> and Charlie Savage <cfis@savagexi.com>
Please see the LICENSE file for copyright and distribution information */
#ifndef __RP_CALL_TREE_H__
#define __RP_CALL_TREE_H__
#include "ruby_prof.h"
#include "rp_measurement.h"
#include "rp_method.h"
extern VALUE cRpCallTree;
/* Callers and callee information for a method. */
typedef struct prof_call_tree_t
{
prof_owner_t owner;
prof_method_t* method;
struct prof_call_tree_t* parent;
st_table* children; /* Call infos that this call info calls */
prof_measurement_t* measurement;
VALUE object;
int visits; /* Current visits on the stack */
unsigned int source_line;
VALUE source_file;
} prof_call_tree_t;
typedef struct prof_meth_table_self_thread_t
{
st_table* self_thread_method_table;
prof_call_tree_t* call_tree;
}prof_meth_table_self_thread_t;
prof_call_tree_t* prof_call_tree_create(prof_method_t* method, prof_call_tree_t* parent, VALUE source_file, int source_line);
prof_call_tree_t* prof_call_tree_copy(prof_call_tree_t* other);
void prof_call_tree_merge_internal(prof_call_tree_t* destination, prof_call_tree_t* other,st_table* self_thread_table);
void prof_call_tree_mark(void* data);
prof_call_tree_t* call_tree_table_lookup(st_table* table, st_data_t key);
void prof_call_tree_add_parent(prof_call_tree_t* self, prof_call_tree_t* parent);
void prof_call_tree_add_child(prof_call_tree_t* self, prof_call_tree_t* child);
uint32_t prof_call_figure_depth(prof_call_tree_t* call_tree_data);
prof_call_tree_t* prof_get_call_tree(VALUE self);
VALUE prof_call_tree_wrap(prof_call_tree_t* call_tree);
void prof_call_tree_free(prof_call_tree_t* call_tree);
void rp_init_call_tree();
#endif //__RP_CALL_TREE_H__