Skip to content

Commit

Permalink
libbpf-tools: initialize global structs in runqlen and softirqs
Browse files Browse the repository at this point in the history
Signed-off-by: Juraj Vijtiuk <[email protected]>
  • Loading branch information
jvijtiuk authored and yonghong-song committed Oct 16, 2020
1 parent 5f53dbe commit 8c2d67e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libbpf-tools/runqlen.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

const volatile bool targ_per_cpu = false;

struct hist hists[MAX_CPU_NR];
struct hist hists[MAX_CPU_NR] = {};

SEC("perf_event")
int do_sample(struct bpf_perf_event_data *ctx)
Expand Down
4 changes: 2 additions & 2 deletions libbpf-tools/softirqs.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ struct {
__type(value, u64);
} start SEC(".maps");

__u64 counts[NR_SOFTIRQS];
struct hist hists[NR_SOFTIRQS];
__u64 counts[NR_SOFTIRQS] = {};
struct hist hists[NR_SOFTIRQS] = {};

SEC("tp_btf/softirq_entry")
int BPF_PROG(softirq_entry, unsigned int vec_nr)
Expand Down

0 comments on commit 8c2d67e

Please sign in to comment.