Skip to content

Commit

Permalink
Explicit tgid (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoftsm authored Sep 25, 2023
1 parent 7a12839 commit 4597a65
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kernel-collector
5 changes: 3 additions & 2 deletions src/process.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ static __always_inline void netdata_fill_common_process_data(struct netdata_pid_

__u64 pid_tgid = bpf_get_current_pid_tgid();
__u32 tgid = (__u32)( 0x00000000FFFFFFFF & pid_tgid);
__u32 pid = (0xFFFFFFFF00000000 & pid_tgid)>>32;

data->pid_tgid = pid_tgid;
data->pid = tgid;
data->tgid = tgid;
data->pid = pid;
}

static __always_inline int netdata_process_not_update_apps()
Expand Down
2 changes: 1 addition & 1 deletion src/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static pid_t ebpf_update_tables(int global, int apps)
{
pid_t pid = ebpf_fill_global(global);

struct netdata_pid_stat_t stats = { .pid = pid, .pid_tgid = pid, .exit_call = 1, .release_call = 1,
struct netdata_pid_stat_t stats = { .pid = pid, .tgid = pid, .exit_call = 1, .release_call = 1,
.create_process = 1, .create_thread = 1, .task_err = 1,
.removeme = 0 };

Expand Down

0 comments on commit 4597a65

Please sign in to comment.