-
-
Save methodmissing/130948 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/sbin/dtrace -s | |
| #pragma D option quiet | |
| typedef struct st_table { | |
| struct st_hash_type *type; | |
| int num_bins; | |
| int num_entries; | |
| struct st_table_entry **bins; | |
| } st_table_t; | |
| translator st_table_t < struct st_table *ST > { | |
| type = (struct st_hash_type *)ST->type; | |
| num_bins = *(int *)copyin((uintptr_t)&ST->num_bins, sizeof (int)); | |
| num_entries = *(int *)copyin((uintptr_t)&ST->num_entries, sizeof (int)); | |
| bins = (struct st_table_entry **)ST->bins; | |
| }; | |
| pid$target::st_lookup:entry { | |
| self->bins = (xlate < st_table_t * > (((st_table_t *)arg0)))->num_bins; | |
| self->entries = (xlate < st_table_t * > (((st_table_t *)arg0)))->num_entries; | |
| printf("\nKey %d, value %d, bins %d, entries %d\n", arg1, *(uint32_t *)copyin(arg2, 4), self->bins, self->entries); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment