KAMEZAWA Hiroyuki 43d2b11324 tracepoint: add tracepoints for debugging oom_score_adj
oom_score_adj is used for guarding processes from OOM-Killer.  One of
problem is that it's inherited at fork().  When a daemon set oom_score_adj
and make children, it's hard to know where the value is set.

This patch adds some tracepoints useful for debugging. This patch adds
3 trace points.
  - creating new task
  - renaming a task (exec)
  - set oom_score_adj

To debug, users need to enable some trace pointer. Maybe filtering is useful as

# EVENT=/sys/kernel/debug/tracing/events/task/
# echo "oom_score_adj != 0" > $EVENT/task_newtask/filter
# echo "oom_score_adj != 0" > $EVENT/task_rename/filter
# echo 1 > $EVENT/enable
# EVENT=/sys/kernel/debug/tracing/events/oom/
# echo 1 > $EVENT/enable

output will be like this.
# grep oom /sys/kernel/debug/tracing/trace
bash-7699  [007] d..3  5140.744510: oom_score_adj_update: pid=7699 comm=bash oom_score_adj=-1000
bash-7699  [007] ...1  5151.818022: task_newtask: pid=7729 comm=bash clone_flags=1200011 oom_score_adj=-1000
ls-7729  [003] ...2  5151.818504: task_rename: pid=7729 oldcomm=bash newcomm=ls oom_score_adj=-1000
bash-7699  [002] ...1  5175.701468: task_newtask: pid=7730 comm=bash clone_flags=1200011 oom_score_adj=-1000
grep-7730  [007] ...2  5175.701993: task_rename: pid=7730 oldcomm=bash newcomm=grep oom_score_adj=-1000

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10 16:30:44 -08:00
..
2012-01-03 22:55:01 -05:00
2012-01-03 22:55:04 -05:00
2012-01-03 22:54:53 -05:00
2012-01-03 22:54:53 -05:00
2012-01-03 22:54:07 -05:00
2012-01-09 16:36:12 -05:00
2012-01-03 22:54:53 -05:00
2012-01-03 22:54:57 -05:00
2011-11-22 16:43:32 -05:00
2012-01-03 22:55:10 -05:00
2012-01-03 22:54:54 -05:00
2012-01-03 22:55:05 -05:00
2012-01-09 10:48:11 -05:00
2012-01-03 22:55:06 -05:00
2011-03-31 11:26:23 -03:00
2012-01-03 22:55:01 -05:00
2012-01-03 22:55:07 -05:00
2012-01-03 22:55:03 -05:00
2011-11-02 16:07:03 -07:00
2012-01-03 22:55:11 -05:00
2012-01-03 22:54:54 -05:00
2011-11-16 09:21:50 +01:00
2012-01-03 22:54:07 -05:00
2012-01-03 22:54:07 -05:00
2012-01-09 19:23:45 -05:00
2012-01-03 22:52:39 -05:00
2012-01-05 15:40:12 -08:00
2012-01-03 22:54:07 -05:00
2011-05-26 10:01:43 -06:00
2012-01-03 22:52:41 -05:00
2011-10-31 17:30:44 -07:00
2012-01-03 22:52:40 -05:00
2012-01-03 22:54:07 -05:00
2011-11-02 12:53:43 +01:00
2012-01-03 22:53:07 -05:00
2012-01-03 22:54:07 -05:00
2012-01-03 22:52:40 -05:00