Skip to content

Commit

Permalink
selftests/bpf: fix compilation error in progs/profiler.inc.h
Browse files Browse the repository at this point in the history
Fix the following error when compiling selftests/bpf

progs/profiler.inc.h:246:5: error: redefinition of 'pids_cgrp_id' as different kind of symbol

pids_cgrp_id is used in cgroup code, and included in vmlinux.h. Fix the
error by renaming pids_cgrp_id as pids_cgroup_id.

Fixes: 03d4d13 ("selftests/bpf: Add profiler test")
Signed-off-by: Song Liu <songliubraving@fb.com>
  • Loading branch information
liu-song-6 authored and kernel-patches-bot committed Oct 14, 2020
1 parent 77476a5 commit 0ef7993
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/bpf/progs/profiler.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static ino_t get_inode_from_kernfs(struct kernfs_node* node)
}
}

int pids_cgrp_id = 1;
int pids_cgroup_id = 1;

static INLINE void* populate_cgroup_info(struct cgroup_data_t* cgroup_data,
struct task_struct* task,
Expand All @@ -262,7 +262,7 @@ static INLINE void* populate_cgroup_info(struct cgroup_data_t* cgroup_data,
BPF_CORE_READ(task, cgroups, subsys[i]);
if (subsys != NULL) {
int subsys_id = BPF_CORE_READ(subsys, ss, id);
if (subsys_id == pids_cgrp_id) {
if (subsys_id == pids_cgroup_id) {
proc_kernfs = BPF_CORE_READ(subsys, cgroup, kn);
root_kernfs = BPF_CORE_READ(subsys, ss, root, kf_root, kn);
break;
Expand Down

0 comments on commit 0ef7993

Please sign in to comment.