From e374aaf1c44cb61bb407fa502926651e3291254d Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 27 Sep 2011 18:50:09 -0400 Subject: [PATCH] Fetch "type" name field for mount syscall Signed-off-by: Mathieu Desnoyers --- .../headers/x86-32-syscalls-3.1.0-rc6_pointers.h | 12 ++++++------ .../headers/x86-64-syscalls-3.0.4_pointers.h | 4 ++-- .../syscalls/lttng-syscalls-generate-headers.sh | 7 ++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/instrumentation/syscalls/headers/x86-32-syscalls-3.1.0-rc6_pointers.h b/instrumentation/syscalls/headers/x86-32-syscalls-3.1.0-rc6_pointers.h index 5d11b194..bcabc194 100644 --- a/instrumentation/syscalls/headers/x86-32-syscalls-3.1.0-rc6_pointers.h +++ b/instrumentation/syscalls/headers/x86-32-syscalls-3.1.0-rc6_pointers.h @@ -1344,8 +1344,8 @@ SC_TRACE_EVENT(sys_kexec_load, SC_TRACE_EVENT(sys_request_key, TP_PROTO(const char * _type, const char * _description, const char * _callout_info, key_serial_t destringid), TP_ARGS(_type, _description, _callout_info, destringid), - TP_STRUCT__entry(__field_hex(const char *, _type) __field_hex(const char *, _description) __field_hex(const char *, _callout_info) __field(key_serial_t, destringid)), - TP_fast_assign(tp_assign(_type, _type) tp_assign(_description, _description) tp_assign(_callout_info, _callout_info) tp_assign(destringid, destringid)), + TP_STRUCT__entry(__string(_type, _type) __field_hex(const char *, _description) __field_hex(const char *, _callout_info) __field(key_serial_t, destringid)), + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_callout_info, _callout_info) tp_assign(destringid, destringid)), TP_printk() ) #endif @@ -1461,8 +1461,8 @@ SC_TRACE_EVENT(sys_sendmmsg, SC_TRACE_EVENT(sys_mount, TP_PROTO(char * dev_name, char * dir_name, char * type, unsigned long flags, void * data), TP_ARGS(dev_name, dir_name, type, flags, data), - TP_STRUCT__entry(__string(dev_name, dev_name) __string(dir_name, dir_name) __field_hex(char *, type) __field(unsigned long, flags) __field_hex(void *, data)), - TP_fast_assign(tp_copy_string_from_user(dev_name, dev_name) tp_copy_string_from_user(dir_name, dir_name) tp_assign(type, type) tp_assign(flags, flags) tp_assign(data, data)), + TP_STRUCT__entry(__string(dev_name, dev_name) __string(dir_name, dir_name) __string(type, type) __field(unsigned long, flags) __field_hex(void *, data)), + TP_fast_assign(tp_copy_string_from_user(dev_name, dev_name) tp_copy_string_from_user(dir_name, dir_name) tp_copy_string_from_user(type, type) tp_assign(flags, flags) tp_assign(data, data)), TP_printk() ) #endif @@ -1551,8 +1551,8 @@ SC_TRACE_EVENT(sys_waitid, SC_TRACE_EVENT(sys_add_key, TP_PROTO(const char * _type, const char * _description, const void * _payload, size_t plen, key_serial_t ringid), TP_ARGS(_type, _description, _payload, plen, ringid), - TP_STRUCT__entry(__field_hex(const char *, _type) __field_hex(const char *, _description) __field_hex(const void *, _payload) __field(size_t, plen) __field(key_serial_t, ringid)), - TP_fast_assign(tp_assign(_type, _type) tp_assign(_description, _description) tp_assign(_payload, _payload) tp_assign(plen, plen) tp_assign(ringid, ringid)), + TP_STRUCT__entry(__string(_type, _type) __field_hex(const char *, _description) __field_hex(const void *, _payload) __field(size_t, plen) __field(key_serial_t, ringid)), + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_payload, _payload) tp_assign(plen, plen) tp_assign(ringid, ringid)), TP_printk() ) #endif diff --git a/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers.h b/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers.h index 0a8a3acf..30441f95 100644 --- a/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers.h +++ b/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers.h @@ -1362,8 +1362,8 @@ SC_TRACE_EVENT(sys_msgrcv, SC_TRACE_EVENT(sys_mount, TP_PROTO(char * dev_name, char * dir_name, char * type, unsigned long flags, void * data), TP_ARGS(dev_name, dir_name, type, flags, data), - TP_STRUCT__entry(__string(dev_name, dev_name) __string(dir_name, dir_name) __field_hex(char *, type) __field(unsigned long, flags) __field_hex(void *, data)), - TP_fast_assign(tp_copy_string_from_user(dev_name, dev_name) tp_copy_string_from_user(dir_name, dir_name) tp_assign(type, type) tp_assign(flags, flags) tp_assign(data, data)), + TP_STRUCT__entry(__string(dev_name, dev_name) __string(dir_name, dir_name) __string(type, type) __field(unsigned long, flags) __field_hex(void *, data)), + TP_fast_assign(tp_copy_string_from_user(dev_name, dev_name) tp_copy_string_from_user(dir_name, dir_name) tp_copy_string_from_user(type, type) tp_assign(flags, flags) tp_assign(data, data)), TP_printk() ) #endif diff --git a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh index 5fb1f8fa..4b10f3f0 100644 --- a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh +++ b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh @@ -237,14 +237,15 @@ echo -n \ #endif /* CREATE_SYSCALL_TABLE */ " >> ${HEADER} -#fields names: ...char * type with *name* or *file* or *path* or *root* or *put_old* +#fields names: ...char * type with *name* or *file* or *path* or *root* +# or *put_old* or *type* cp -f ${HEADER} ${TMPFILE} rm -f ${HEADER} -perl -p -e 's/__field\(([^,)]*char \*), ([^\)]*)(name|file|path|root|put_old)([^\)]*)\)/__string($2$3$4, $2$3$4)/g'\ +perl -p -e 's/__field\(([^,)]*char \*), ([^\)]*)(name|file|path|root|put_old|type)([^\)]*)\)/__string($2$3$4, $2$3$4)/g'\ ${TMPFILE} >> ${HEADER} cp -f ${HEADER} ${TMPFILE} rm -f ${HEADER} -perl -p -e 's/tp_assign\(([^,)]*char \*), ([^,]*)(name|file|path|root|put_old)([^,]*), ([^\)]*)\)/tp_copy_string_from_user($2$3$4, $5)/g'\ +perl -p -e 's/tp_assign\(([^,)]*char \*), ([^,]*)(name|file|path|root|put_old|type)([^,]*), ([^\)]*)\)/tp_copy_string_from_user($2$3$4, $5)/g'\ ${TMPFILE} >> ${HEADER} #prettify addresses heuristics. -- 2.34.1