Repository navigation
fix(irqsnoop): print per-interval summary tables instead of raw event flood - #162
yuKing123-king wants to merge 1 commit into
Conversation
7eed47b to
49d4af0
Compare
问题
修复
|
66ea7ff to
38e430c
Compare
| stat.total_time += e->delta; | ||
| // 只处理IRQ类型事件 | ||
| if (e->type == IRQ) | ||
| if (env.live) |
There was a problem hiding this comment.
if (!env.live)
return 0;
简化处理
There was a problem hiding this comment.
另一个问题,为什么加这个?同步有问题?,这个也保证不了不同
There was a problem hiding this comment.
加这个是为了让./build/observe/irqsnoop无参数时正常逐条打印
[SOFTIRQ] pid=3134715 tid=3134729 comm=CPU 1/TCG vec=rcu delta=627ns ret=0
[SOFTIRQ] pid=3134715 tid=3134729 comm=CPU 1/TCG vec=rcu delta=1844ns ret=0然后ctrl C 汇总
让sudo ./build/observe/irqsnoop 3 10 ,有参数时,每三秒汇总,总共打印10次。就不逐条打印信息了,直接打印汇总的信息。
Tracing IRQ/SoftIRQ events... Hit Ctrl-C to end.
type vec time(usec)
softirq hi 15
softirq timer 51
softirq net_rx 167
softirq block 22
softirq tasklet 0
softirq sched 2323
softirq rcu 554
irq irq127 9
irq irq132 26
irq irq133 20
irq irq134 5
irq irq135 246
type vec time(usec)
softirq hi 41
softirq timer 76
softirq net_rx 623
softirq sched 3286
softirq rcu 734
irq irq124 0
irq irq125 29
irq irq128 11
irq irq129 1
irq irq132 2332357390194
irq irq134 16
irq irq135 469
^Ctype vec time(usec)
softirq timer 54
softirq net_rx 291
softirq tasklet 2
softirq sched 1441
softirq rcu 315
irq irq124 70
irq irq125 8
irq irq126 12
irq irq127 3
irq irq131 15
irq irq132 31
irq irq135 204
| { | ||
| return 0; | ||
| } | ||
| auto &stat = summary_map[{(int)e->type, (int)e->vec_nr}]; |
There was a problem hiding this comment.
写法优化下,不要用pair,两个int,可以直接组装long作为key
| return; | ||
| } | ||
| } | ||
| #ifndef BUILTIN |
There was a problem hiding this comment.
这个工具之前就有builtin的部分了,这里ringbuffer_worker是公共区,但是print_summary();又是非BUILTIN的所以得隔开一下
38e430c to
d137acb
Compare
| e->name, | ||
| e->delta, | ||
| e->ret | ||
| "[IRQ] pid=%d tid=%d comm=%s irq=%d name=%s delta=%lluns " |
| } | ||
| // 只处理IRQ类型事件 | ||
| unsigned long long key = | ||
| ((unsigned long long)(unsigned int)e->type << 32) | |
There was a problem hiding this comment.
(unsigned long long)(unsigned int)e->type ????两次强转何意味
|
AI review
|
e8690f8 to
b1186ec
Compare
… flood Signed-off-by: Wang Yu <wangyu6@uniontech.com>
b1186ec to
6c689ca
Compare
No description provided.