Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
vmprof-python/src/vmprof_common.h at master · wenlien/vmprof-python · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
wenlien
/
vmprof-python
Public
forked from
vmprof/vmprof-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Files
Expand file tree
master
Breadcrumbs
vmprof-python
/
src
/
vmprof_common.h
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
104 lines (87 loc) · 2.52 KB
master
Breadcrumbs
vmprof-python
/
src
/
vmprof_common.h
Copy path
Top
File metadata and controls
Code
Blame
104 lines (87 loc) · 2.52 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#pragma
once
#include
"vmprof.h"
#include
"machine.h"
#include
"compat.h"
#include
<stddef.h>
#include
<time.h>
#include
<stdlib.h>
#ifdef
VMPROF_UNIX
#include
<sys/time.h>
#include
"vmprof_mt.h"
#include
<signal.h>
#include
<pthread.h>
#endif
#ifdef
VMPROF_UNIX
#include
"vmprof_getpc.h"
#endif
#ifdef
VMPROF_LINUX
#include
<syscall.h>
#endif
#ifdef
VMPROF_BSD
#include
<sys/syscall.h>
#endif
#define
MAX_FUNC_NAME
1024
#ifdef
VMPROF_UNIX
ssize_t
search_thread
(
pthread_t
tid
,
ssize_t
i
);
ssize_t
insert_thread
(
pthread_t
tid
,
ssize_t
i
);
ssize_t
remove_thread
(
pthread_t
tid
,
ssize_t
i
);
ssize_t
remove_threads
(
void
);
#endif
#define
MAX_STACK_DEPTH
\
((SINGLE_BUF_SIZE - sizeof(struct prof_stacktrace_s)) / sizeof(void *))
/*
* NOTE SHOULD NOT BE DONE THIS WAY. Here is an example why:
* assume the following struct content:
* struct ... {
* char padding[sizeof(long) - 1];
* char marker;
* long count, depth;
* void *stack[];
* }
*
* Here a table of the offsets on a 64 bit machine:
* field | GCC | VSC (windows)
* ---------------------------
* marker | 7 | 3
* count | 8 | 4
* depth | 16 | 8
* stack | 24 | 16 (VSC adds 4 padding byte hurray!)
*
* This means that win32 worked by chance (because sizeof(void*)
* is 4, but fails on win32
*/
typedef
struct
prof_stacktrace_s
{
#ifdef
VMPROF_WINDOWS
// if padding is 8 bytes, then on both 32bit and 64bit, the
// stack field is aligned
char
padding
[
sizeof
(
void
*
)
-
1
];
#else
char
padding
[
sizeof
(
long
)
-
1
];
#endif
char
marker
;
long
count
,
depth
;
void
*
stack
[];
}
prof_stacktrace_s
;
#define
SIZEOF_PROF_STACKTRACE
sizeof(long)+sizeof(long)+sizeof(char)
RPY_EXTERN
char
*
vmprof_init
(
int
fd
,
double
interval
,
int
memory
,
int
proflines
,
const
char
*
interp_name
,
int
native
,
int
real_time
);
int
opened_profile
(
const
char
*
interp_name
,
int
memory
,
int
proflines
,
int
native
,
int
real_time
);
#ifdef
RPYTHON_VMPROF
PY_STACK_FRAME_T
*
get_vmprof_stack
(
void
);
RPY_EXTERN
intptr_t
vmprof_get_traceback
(
void
*
stack
,
void
*
ucontext
,
void
*
*
result_p
,
intptr_t
result_length
);
#endif
int
vmprof_get_signal_type
(
void
);
long
vmprof_get_prepare_interval_usec
(
void
);
long
vmprof_get_profile_interval_usec
(
void
);
void
vmprof_set_prepare_interval_usec
(
long
value
);
void
vmprof_set_profile_interval_usec
(
long
value
);
int
vmprof_is_enabled
(
void
);
void
vmprof_set_enabled
(
int
value
);
int
vmprof_get_itimer_type
(
void
);
#ifdef
VMPROF_UNIX
int
broadcast_signal_for_threads
(
void
);
int
is_main_thread
(
void
);
#endif
You can’t perform that action at this time.