-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows for capturing lmk kill events and their rationale. Change-Id: Ibe215db5bb9806fc550c72c0b9832c85cbd56bf6 Signed-off-by: Martijn Coenen <[email protected]>
- Loading branch information
Showing
2 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#undef TRACE_SYSTEM | ||
#define TRACE_INCLUDE_PATH ../../drivers/staging/android/trace | ||
#define TRACE_SYSTEM lowmemorykiller | ||
|
||
#if !defined(_TRACE_LOWMEMORYKILLER_H) || defined(TRACE_HEADER_MULTI_READ) | ||
#define _TRACE_LOWMEMORYKILLER_H | ||
|
||
#include <linux/tracepoint.h> | ||
|
||
TRACE_EVENT(lowmemory_kill, | ||
TP_PROTO(struct task_struct *killed_task, long cache_size, \ | ||
long cache_limit, long free), | ||
|
||
TP_ARGS(killed_task, cache_size, cache_limit, free), | ||
|
||
TP_STRUCT__entry( | ||
__array(char, comm, TASK_COMM_LEN) | ||
__field(pid_t, pid) | ||
__field(long, pagecache_size) | ||
__field(long, pagecache_limit) | ||
__field(long, free) | ||
), | ||
|
||
TP_fast_assign( | ||
memcpy(__entry->comm, killed_task->comm, TASK_COMM_LEN); | ||
__entry->pid = killed_task->pid; | ||
__entry->pagecache_size = cache_size; | ||
__entry->pagecache_limit = cache_limit; | ||
__entry->free = free; | ||
), | ||
|
||
TP_printk("%s (%d), page cache %ldkB (limit %ldkB), free %ldKb", | ||
__entry->comm, __entry->pid, __entry->pagecache_size, | ||
__entry->pagecache_limit, __entry->free) | ||
); | ||
|
||
|
||
#endif /* if !defined(_TRACE_LOWMEMORYKILLER_H) || defined(TRACE_HEADER_MULTI_READ) */ | ||
|
||
/* This part must be outside protection */ | ||
#include <trace/define_trace.h> |