Skip to content

Commit

Permalink
add picotls_ prefix to all the probe names defined by picotls, beca…
Browse files Browse the repository at this point in the history
…use USDT probes on Linux does not have namespaces within one executable
  • Loading branch information
kazuho committed May 5, 2019
1 parent 9a2d9d1 commit 389a496
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/picotls.c
Expand Up @@ -97,8 +97,8 @@
#if PICOTLS_USE_DTRACE
#define PTLS_PROBE(LABEL, ...) \
do { \
if (PICOTLS_##LABEL##_ENABLED()) { \
PICOTLS_##LABEL(__VA_ARGS__); \
if (PICOTLS_PICOTLS_##LABEL##_ENABLED()) { \
PICOTLS_PICOTLS_##LABEL(__VA_ARGS__); \
} \
} while (0)
#else
Expand Down
8 changes: 4 additions & 4 deletions misc/dtrace/bpftrace.d
Expand Up @@ -25,17 +25,17 @@
* % sudo bpftrace -p $(pidof cli) /mydev/picotls/misc/dtrace/bpftrace.d
*/

usdt::new {
usdt::picotls_new {
printf("{\"addr\": \"%p\", \"event\": \"new\", \"is_server\": %d}\n", arg0, arg1);
}
usdt::free {
usdt::picotls_free {
printf("{\"addr\": \"%p\", \"event\": \"free\"}\n", arg0);
}
usdt::client_random {
usdt::picotls_client_random {
printf("{\"addr\": \"%p\", \"event\": \"client_random\"", arg0);
printf(", \"bytes\": \"%s\"}\n", str(arg1));
}
usdt::new_secret {
usdt::picotls_new_secret {
printf("\"addr\": \"%p\", \"event\": \"new_secret\"", arg0);
printf(", \"label\": \"%s\", \"secret\": \"%s\"}\n", str(arg1), str(arg2));
}
10 changes: 5 additions & 5 deletions misc/dtrace/dtrace.d
Expand Up @@ -25,19 +25,19 @@
* % sudo dtrace -c './cli 127.0.0.1 4433' -s misc/dtrace/dtrace.d
*/

picotls$target:::new {
picotls$target:::picotls_new {
printf("\n{\"addr\": \"0x%p\", \"event\": \"new\", \"is_server\": %d}", arg0, arg1);
}
picotls$target:::free {
picotls$target:::picotls_free {
printf("\n{\"addr\": \"0x%p\", \"event\": \"free\"}", arg0);
}
picotls$target:::client_random {
picotls$target:::picotls_client_random {
printf("\n{\"addr\": \"0x%p\", \"event\": \"client_random\", \"bytes\": \"%s\"}", arg0, copyinstr(arg1));
}
picotls$target:::new_secret {
picotls$target:::picotls_new_secret {
printf("\n{\"addr\": \"0x%p\", \"event\": \"new_secret\", \"label\": \"%s\", \"secret\": \"%s\"}", arg0, copyinstr(arg1), copyinstr(arg2));
}
picotls$target:::receive_message {
picotls$target:::picotls_receive_message {
printf("\n{\"addr\": \"0x%p\", \"event\": \"receive_message\", \"type\": %d, \"ret\": %d}\n", arg0, arg1, arg4);
tracemem(copyin(arg2, arg3), 65535, arg3);
}
10 changes: 5 additions & 5 deletions probes.d
Expand Up @@ -21,9 +21,9 @@
*/

provider picotls {
probe new(struct st_ptls_t *tls, int is_server);
probe free(struct st_ptls_t *tls);
probe client_random(struct st_ptls_t *tls, const void *bytes);
probe receive_message(struct st_ptls_t *tls, uint8_t message, const void *bytes, size_t len, int result);
probe new_secret(struct st_ptls_t *tls, const char *label, const char *secret_hex);
probe picotls_new(struct st_ptls_t *tls, int is_server);
probe picotls_free(struct st_ptls_t *tls);
probe picotls_client_random(struct st_ptls_t *tls, const void *bytes);
probe picotls_receive_message(struct st_ptls_t *tls, uint8_t message, const void *bytes, size_t len, int result);
probe picotls_new_secret(struct st_ptls_t *tls, const char *label, const char *secret_hex);
};

0 comments on commit 389a496

Please sign in to comment.