bpo-31574: importlib dtrace (#3749) · pythoncapi/cpython@3d2b407 · GitHub
Skip to content

Commit 3d2b407

Browse files
tiranambv
authored andcommitted
bpo-31574: importlib dtrace (python#3749)
Importlib was instrumented with two dtrace probes to profile import timing. Signed-off-by: Christian Heimes <christian@python.org>
1 parent 574562c commit 3d2b407

5 files changed

Lines changed: 28 additions & 0 deletions

File tree

Doc/howto/instrumentation.rst

Lines changed: 11 additions & 0 deletions

Include/pydtrace.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ provider python {
1010
probe line(const char *, const char *, int);
1111
probe gc__start(int);
1212
probe gc__done(long);
13+
probe import__find__load__start(const char *);
14+
probe import__find__load__done(const char *, int);
1315
};
1416

1517
#pragma D attributes Evolving/Evolving/Common provider python provider

Include/pydtrace.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ static inline void PyDTrace_INSTANCE_NEW_START(int arg0) {}
3434
static inline void PyDTrace_INSTANCE_NEW_DONE(int arg0) {}
3535
static inline void PyDTrace_INSTANCE_DELETE_START(int arg0) {}
3636
static inline void PyDTrace_INSTANCE_DELETE_DONE(int arg0) {}
37+
static inline void PyDTrace_IMPORT_FIND_LOAD_START(const char *arg0) {}
38+
static inline void PyDTrace_IMPORT_FIND_LOAD_DONE(const char *arg0, int arg1) {}
3739

3840
static inline int PyDTrace_LINE_ENABLED(void) { return 0; }
3941
static inline int PyDTrace_FUNCTION_ENTRY_ENABLED(void) { return 0; }
@@ -44,6 +46,8 @@ static inline int PyDTrace_INSTANCE_NEW_START_ENABLED(void) { return 0; }
4446
static inline int PyDTrace_INSTANCE_NEW_DONE_ENABLED(void) { return 0; }
4547
static inline int PyDTrace_INSTANCE_DELETE_START_ENABLED(void) { return 0; }
4648
static inline int PyDTrace_INSTANCE_DELETE_DONE_ENABLED(void) { return 0; }
49+
static inline int PyDTrace_IMPORT_FIND_LOAD_START_ENABLED(void) { return 0; }
50+
static inline int PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED(void) { return 0; }
4751

4852
#endif /* !WITH_DTRACE */
4953

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Importlib was instrumented with two dtrace probes to profile import timing.

Python/import.c

Lines changed: 10 additions & 0 deletions

0 commit comments

Comments
 (0)