Skip to content

Commit

Permalink
tools/oomkill: output PID instead of thread ID (user's view)
Browse files Browse the repository at this point in the history
  • Loading branch information
boat0 authored and yonghong-song committed Feb 25, 2020
1 parent c949f61 commit 9edbae3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/oomkill.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include <linux/oom.h>
struct data_t {
u64 fpid;
u64 tpid;
u32 fpid;
u32 tpid;
u64 pages;
char fcomm[TASK_COMM_LEN];
char tcomm[TASK_COMM_LEN];
Expand All @@ -40,7 +40,7 @@
unsigned long totalpages;
struct task_struct *p = oc->chosen;
struct data_t data = {};
u32 pid = bpf_get_current_pid_tgid();
u32 pid = bpf_get_current_pid_tgid() >> 32;
data.fpid = pid;
data.tpid = p->pid;
data.pages = oc->totalpages;
Expand Down

0 comments on commit 9edbae3

Please sign in to comment.