Skip to content

Commit

Permalink
libbpf-tools: Fix opensnoop compile errors when uses BlazeSym
Browse files Browse the repository at this point in the history
opensnoop.c:208:79: error: invalid type argument of ‘->’ (have ‘struct event’)
  208 |                 { .src_type = SRC_T_PROCESS, .params = { .process = { .pid = e->pid }}},
      |                                                                               ^~
  • Loading branch information
0lxb authored and chenhengqi committed Jan 1, 2024
1 parent 3469bf1 commit f98774d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libbpf-tools/opensnoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)
struct tm *tm;
#ifdef USE_BLAZESYM
sym_src_cfg cfgs[] = {
{ .src_type = SRC_T_PROCESS, .params = { .process = { .pid = e->pid }}},
{ .src_type = SRC_T_PROCESS, .params = { .process = { .pid = e.pid }}},
};
const blazesym_result *result = NULL;
const blazesym_csym *sym;
Expand All @@ -217,8 +217,8 @@ void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)
int fd, err;

if (data_sz < sizeof(e)) {
printf("Error: packet too small\n");
return;
printf("Error: packet too small\n");
return;
}
/* Copy data as alignment in the perf buffer isn't guaranteed. */
memcpy(&e, data, sizeof(e));
Expand Down

0 comments on commit f98774d

Please sign in to comment.