-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use DTrace for debugging instrumentation instead of hand-rolled stuff.
The saio_debug module is now unused (and not even compiled in). The rest of the code got cleaned up from adhoc debugging and instead now exposes a few strategically positioned DTrace entry points.
- Loading branch information
Showing
9 changed files
with
117 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#------------------------------------------------------------------------- | ||
# sed script to create dummy probes.h file when dtrace is not available | ||
# | ||
# Copyright (c) 2008-2011, PostgreSQL Global Development Group | ||
# | ||
# src/backend/utils/Gen_dummy_probes.sed | ||
#------------------------------------------------------------------------- | ||
|
||
/^[ ]*probe /!d | ||
s/^[ ]*probe \([^(]*\)\(.*\);/\1\2/ | ||
s/__/_/g | ||
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/ | ||
s/^/#define TRACE_SAIO_/ | ||
s/([^,)]\{1,\})/(INT1)/ | ||
s/([^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2)/ | ||
s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3)/ | ||
s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4)/ | ||
s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4, INT5)/ | ||
s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4, INT5, INT6)/ | ||
s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4, INT5, INT6, INT7)/ | ||
s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4, INT5, INT6, INT7, INT8)/ | ||
P | ||
s/(.*$/_ENABLED() (0)/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
provider saio { | ||
probe planning_start(); | ||
probe planning_done(); | ||
|
||
/* param: status, current cost as integer, current temperature, elapsed loops, failed moves */ | ||
probe step_done(int, int, int, int, int); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* Generated by the Systemtap dtrace wrapper */ | ||
|
||
#define _SDT_HAS_SEMAPHORES 1 | ||
|
||
|
||
#define STAP_HAS_SEMAPHORES 1 /* deprecated */ | ||
|
||
|
||
#include <sys/sdt.h> | ||
|
||
/* TRACE_SAIO_PLANNING_START () */ | ||
#if defined STAP_SDT_V1 | ||
#define TRACE_SAIO_PLANNING_START_ENABLED() __builtin_expect (planning_start_semaphore, 0) | ||
#define saio_planning_start_semaphore planning_start_semaphore | ||
#else | ||
#define TRACE_SAIO_PLANNING_START_ENABLED() __builtin_expect (saio_planning_start_semaphore, 0) | ||
#endif | ||
__extension__ extern unsigned short saio_planning_start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); | ||
#define TRACE_SAIO_PLANNING_START() \ | ||
DTRACE_PROBE(saio,planning_start) | ||
|
||
/* TRACE_SAIO_PLANNING_DONE () */ | ||
#if defined STAP_SDT_V1 | ||
#define TRACE_SAIO_PLANNING_DONE_ENABLED() __builtin_expect (planning_done_semaphore, 0) | ||
#define saio_planning_done_semaphore planning_done_semaphore | ||
#else | ||
#define TRACE_SAIO_PLANNING_DONE_ENABLED() __builtin_expect (saio_planning_done_semaphore, 0) | ||
#endif | ||
__extension__ extern unsigned short saio_planning_done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); | ||
#define TRACE_SAIO_PLANNING_DONE() \ | ||
DTRACE_PROBE(saio,planning_done) | ||
|
||
/* TRACE_SAIO_STEP_DONE ( int, int, int, int, int) */ | ||
#if defined STAP_SDT_V1 | ||
#define TRACE_SAIO_STEP_DONE_ENABLED() __builtin_expect (step_done_semaphore, 0) | ||
#define saio_step_done_semaphore step_done_semaphore | ||
#else | ||
#define TRACE_SAIO_STEP_DONE_ENABLED() __builtin_expect (saio_step_done_semaphore, 0) | ||
#endif | ||
__extension__ extern unsigned short saio_step_done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); | ||
#define TRACE_SAIO_STEP_DONE(arg1,arg2,arg3,arg4,arg5) \ | ||
DTRACE_PROBE5(saio,step_done,arg1,arg2,arg3,arg4,arg5) | ||
|
Oops, something went wrong.