summaryrefslogtreecommitdiffstats
path: root/tapset/LKET
diff options
context:
space:
mode:
Diffstat (limited to 'tapset/LKET')
-rw-r--r--tapset/LKET/Changelog10
-rwxr-xr-xtapset/LKET/lket_trace.stp15
-rwxr-xr-xtapset/LKET/process.stp8
-rwxr-xr-xtapset/LKET/register_event.stp2
4 files changed, 24 insertions, 11 deletions
diff --git a/tapset/LKET/Changelog b/tapset/LKET/Changelog
index a3baabdf..9b61f74e 100644
--- a/tapset/LKET/Changelog
+++ b/tapset/LKET/Changelog
@@ -1,3 +1,13 @@
+2006-11-19 Li Guanglei <guanglei@cn.ibm.com>
+ bugfix for #3526
+ * lket_trace.stp: add the logging of pid, ppid
+ * process.stp: add logging of tid, ppid for
+ lket_internal.process.execve. Change to use
+ for_each_process() in process_snapshot() to get
+ the info of all running processes.
+ * register_event.stp: update the registering codes
+ of execve event.
+
2006-11-17 Li Guanglei <guanglei@cn.ibm.com>
From Eugene Teo <eteo@redhat.com>
diff --git a/tapset/LKET/lket_trace.stp b/tapset/LKET/lket_trace.stp
index 32577524..81d47dd6 100755
--- a/tapset/LKET/lket_trace.stp
+++ b/tapset/LKET/lket_trace.stp
@@ -149,9 +149,10 @@ static inline int this_event_len(void)
/* we use 2 bytes to store the length. */
#define _lket_trace(GroupID, hookID, fmt, args...) do { \
if(timing_method == TIMING_GETCYCLES) { \
- _stp_printf("%2b%2n%8b%8b"fmt, (_FMT_)0, \
+ _stp_printf("%2b%2n%8b%8b%8b"fmt, (_FMT_)0, \
(_FMT_)get_cycles(), \
- (_FMT_)((int64_t)current->pid << 32 | \
+ (_FMT_)((int64_t)current->pid << 32 | (int32_t)current->tgid),\
+ (_FMT_)((int64_t)current->parent->tgid << 32 | \
(int32_t)GroupID << 24 | (int32_t)hookID << 16 | \
(int16_t)current->thread_info->cpu << 8), \
args); \
@@ -159,17 +160,19 @@ static inline int this_event_len(void)
else if(timing_method == TIMING_GETTIMEOFDAY) { \
struct timeval tv; \
do_gettimeofday (&tv); \
- _stp_printf("%2b%2n%8b%8b"fmt, (_FMT_)0, \
+ _stp_printf("%2b%2n%8b%8b%8b"fmt, (_FMT_)0, \
(_FMT_)(tv.tv_sec*1000000LL + tv.tv_usec), \
- (_FMT_)((int64_t)current->pid << 32 | \
+ (_FMT_)((int64_t)current->pid << 32 | (int32_t)current->tgid),\
+ (_FMT_)((int64_t)current->parent->tgid << 32 | \
(int32_t)GroupID << 24 | (int32_t)hookID << 16 | \
(int16_t)current->thread_info->cpu << 8), \
args); \
} \
else { \
- _stp_printf("%2b%2n%8b%8b"fmt, (_FMT_)0, \
+ _stp_printf("%2b%2n%8b%8b%8b"fmt, (_FMT_)0, \
(_FMT_)pfn_schedclock(), \
- (_FMT_)((int64_t)current->pid << 32 | \
+ (_FMT_)((int64_t)current->pid << 32 | (int32_t)current->tgid),\
+ (_FMT_)((int64_t)current->parent->tgid << 32 | \
(int32_t)GroupID << 24 | (int32_t)hookID << 16 | \
(int16_t)current->thread_info->cpu << 8), \
args); \
diff --git a/tapset/LKET/process.stp b/tapset/LKET/process.stp
index 12eca381..fb02614b 100755
--- a/tapset/LKET/process.stp
+++ b/tapset/LKET/process.stp
@@ -12,8 +12,9 @@
function log_execve_tracedata(var:long)
%{
long tmp=(long)THIS->var;
- _lket_trace(_GROUP_PROCESS, _HOOKID_PROCESS_EXECVE, "%4b%0s",
- (_FMT_)current->tgid, (char *)tmp);
+ _lket_trace(_GROUP_PROCESS, _HOOKID_PROCESS_EXECVE, "%4b%4b%4b%0s",
+ (_FMT_)current->pid, (_FMT_)current->tgid,
+ (_FMT_)current->parent->tgid, (char *)tmp);
%}
@@ -46,8 +47,7 @@ function process_snapshot()
/* iterate all the processes, and record the pid and process
name for each entry */
- list_for_each(cur, head) {
- tsk = (struct task_struct *)(list_entry(cur, struct task_struct, tasks));
+ for_each_process(tsk) {
_lket_trace(_GROUP_PROCESS, _HOOKID_PROCESS_SNAPSHOT, "%4b%4b%4b%0s",
(_FMT_)tsk->pid, (_FMT_)tsk->tgid, (_FMT_)tsk->parent->tgid, tsk->comm);
#if !defined(ASCII_TRACE)
diff --git a/tapset/LKET/register_event.stp b/tapset/LKET/register_event.stp
index 4bc3fcd4..333471e8 100755
--- a/tapset/LKET/register_event.stp
+++ b/tapset/LKET/register_event.stp
@@ -164,7 +164,7 @@ function register_sys_events()
_register_sys_event("process_snapshot", _GROUP_PROCESS, _HOOKID_PROCESS_SNAPSHOT,
"INT32:INT32:INT32:STRING", "tid:pid:ppid:pname");
_register_sys_event("process.execve", _GROUP_PROCESS, _HOOKID_PROCESS_EXECVE,
- "INT32:STRING", "pid:pname");
+ "INT32:INT32:INT32:STRING", "tid:pid:ppid:pname");
_register_sys_event("process.fork", _GROUP_PROCESS, _HOOKID_PROCESS_FORK,
"INT32:INT32:INT32", "tid:pid:ppid");
_register_sys_event("process.exit.entry", _GROUP_PROCESS, _HOOKID_PROCESS_EXIT_ENTRY,