RE: [bpf-next 3/3] samples/bpf: Add soft irq execution time statistics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Xin Hao wrote:
> This patch is aimed to count the execution time of
> each soft irq and it supports log2 histogram display.
> 
> Soft irq counts:
>      us	             : count    distribution
> 
>      0 -> 1	     : 151      |****************************************|
>      2 -> 3          : 86       |**********************                  |
>      4 -> 7          : 59       |***************                         |
>      8 -> 15         : 20       |*****                                   |
>     16 -> 31         : 3        |			                 |
> 
> Signed-off-by: Xin Hao <xhao@xxxxxxxxxxxxxxxxx>

Couple nits otherwise LGTM.

> ---

[...]

> +
> +typedef struct key {
> +	u32 pid;
> +	u32 cpu;
> +} irqkey_t;
> +
> +typedef struct val {
> +	u64 ts;
> +	u32 vec;
> +} val_t;
> +
> +typedef struct delta_irq {
> +	u64 delta;
> +    u32 value;

should be a tab

> +} delta_irq_t;
> +
> +struct bpf_map_def SEC("maps") start = {
> +	.type = BPF_MAP_TYPE_HASH,
> +	.key_size = sizeof(irqkey_t),
> +	.value_size = sizeof(val_t),
> +	.max_entries = 1000,
> +};

Seems more common to use the style,

struct {
	__uint(type, ...);
	__uint(max_entries,...);
	...

} start SEC{".maps");

> +
> +struct soft_irq {
> +	u64 pad;
> +    u32 vec;

spaces -> tabs, probably run ./contrib/scripts/checkpatch on the rest and
cleanup the other cases as well.

[...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux