#
209dded0 |
|
17-Nov-2017 |
Carlos Pizano <cpu@google.com> |
[zircon][kernel] kernel counters Implementation based on the requirement doc by travisg. This is only the core kernel part. The implementation uses linker tricks to set as much as possible static memory so they can be used early and be declared almost anywhere. The counters are stored in per-cpu arrays so that there is no need to use atomics to keep the increments consistent and there is no false cache line sharing. The counters are exposed via a temporary kernel command 'k counters' This change also adds 11 counters, here is sample output. $ k counters all [00006.351] 01044.01047> 11 counters available: [00006.351] 01044.01047> [0] kernel.dispatcher.cookie.reset <0> [00006.351] 01044.01047> [1] kernel.dispatcher.cookie.set <0> [00006.351] 01044.01047> [2] kernel.dispatcher.create [00006.351] 01044.01047> [0:451][1:226][2:285][3:561] = 1523 [00006.351] 01044.01047> [3] kernel.dispatcher.destroy [00006.351] 01044.01047> [0:223][1:174][2:161][3:354] = 912 [00006.351] 01044.01047> [4] kernel.dispatcher.observer.add [00006.351] 01044.01047> [5] kernel.dispatcher.observer.cancel.byhandle [00006.351] 01044.01047> [0:474][1:327][2:334][3:622] = 1757 [00006.351] 01044.01047> [6] kernel.dispatcher.observer.cancel.bykey <0> [00006.351] 01044.01047> [7] kernel.thread.create [00006.351] 01044.01047> [0:15][1:4][2:5][3:17] = 41 [00006.351] 01044.01047> [8] kernel.thread.join [00006.351] 01044.01047> [1:1][2:4] = 5 [00006.351] 01044.01047> [9] kernel.thread.resume [00006.351] 01044.01047> [0:12][1:4][2:5][3:17] = 38 [00006.351] 01044.01047> [10] kernel.thread.suspend <0> Change-Id: I5eaabc3b7646dcaca72604953f0fb5338b3a776d
|