-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hist: log2 histograms with finer granularity
Allow a second optional argument in hist(n, k) to map each power of 2 into 2^k buckets, thus creating a logarithmic scale with finer granularity and modest runtime overhead (a couple of shifts and add/mask in addition to the original algorithm). Allowed values of k are 0..5, with 0 as default for backward compatibility. The implementation follows my earlier code in https://github.com/luigirizzo/lr-cstats Example below: $ sudo src/bpftrace -e 'kfunc:tick_do_update_jiffies64 { @ = hist((nsecs & 0xff),2); }' Attaching 2 probes... @: [0] 4 |@ | [1] 1 | | [2] 3 |@ | [3] 2 | | [4] 3 |@ | [5] 0 | | [6] 3 |@ | [7] 2 | | [8, 10) 5 |@ | [10, 12) 7 |@@ | [12, 14) 5 |@ | [14, 16) 6 |@@ | [16, 20) 11 |@@@ | [20, 24) 14 |@@@@ | [24, 28) 20 |@@@@@@ | [28, 32) 13 |@@@@ | [32, 40) 40 |@@@@@@@@@@@@@ | [40, 48) 38 |@@@@@@@@@@@@@ | [48, 56) 35 |@@@@@@@@@@@ | [56, 64) 29 |@@@@@@@@@ | [64, 80) 72 |@@@@@@@@@@@@@@@@@@@@@@@@ | [80, 96) 64 |@@@@@@@@@@@@@@@@@@@@@ | [96, 112) 61 |@@@@@@@@@@@@@@@@@@@@ | [112, 128) 67 |@@@@@@@@@@@@@@@@@@@@@@ | [128, 160) 124 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | [160, 192) 130 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | [192, 224) 124 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | [224, 256) 152 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
- Loading branch information
1 parent
baf41c9
commit 6d193bb
Showing
11 changed files
with
152 additions
and
109 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
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
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
Oops, something went wrong.