+++ /dev/null
-From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
-Subject: LTTng instrumentation - ipc
-
-Original patch header:
- LTTng instrumentation - ipc
-
- Interprocess communication, core events.
-
- Added tracepoints :
-
- ipc_msg_create
- ipc_sem_create
- ipc_shm_create
-
- Those tracepoints are used by LTTng.
-
- About the performance impact of tracepoints (which is comparable to markers),
- even without immediate values optimizations, tests done by Hideo Aoki on ia64
- show no regression. His test case was using hackbench on a kernel where
- scheduler instrumentation (about 5 events in code scheduler code) was added.
- See the "Tracepoints" patch header for performance result detail.
-
- Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
- CC: Masami Hiramatsu <mhiramat@redhat.com>
- CC: 'Peter Zijlstra' <peterz@infradead.org>
- CC: "Frank Ch. Eigler" <fche@redhat.com>
- CC: 'Ingo Molnar' <mingo@elte.hu>
- CC: 'Hideo AOKI' <haoki@redhat.com>
- CC: Takashi Nishiie <t-nishiie@np.css.fujitsu.com>
- CC: 'Steven Rostedt' <rostedt@goodmis.org>
- CC: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
-
-Acked-by: Jan Blunck <jblunck@suse.de>
----
-Index: linux-2.6-lttng/ipc/msg.c
-===================================================================
---- linux-2.6-lttng.orig/ipc/msg.c 2008-08-06 00:41:47.000000000 -0400
-+++ linux-2.6-lttng/ipc/msg.c 2008-08-06 01:04:20.000000000 -0400
-@@ -38,6 +38,7 @@
- #include <linux/rwsem.h>
- #include <linux/nsproxy.h>
- #include <linux/ipc_namespace.h>
-+#include <trace/ipc.h>
-
- #include <asm/current.h>
- #include <asm/uaccess.h>
-@@ -314,6 +315,7 @@ asmlinkage long sys_msgget(key_t key, in
- struct ipc_namespace *ns;
- struct ipc_ops msg_ops;
- struct ipc_params msg_params;
-+ long ret;
-
- ns = current->nsproxy->ipc_ns;
-
-@@ -324,7 +326,9 @@ asmlinkage long sys_msgget(key_t key, in
- msg_params.key = key;
- msg_params.flg = msgflg;
-
-- return ipcget(ns, &msg_ids(ns), &msg_ops, &msg_params);
-+ ret = ipcget(ns, &msg_ids(ns), &msg_ops, &msg_params);
-+ trace_ipc_msg_create(ret, msgflg);
-+ return ret;
- }
-
- static inline unsigned long
-Index: linux-2.6-lttng/ipc/sem.c
-===================================================================
---- linux-2.6-lttng.orig/ipc/sem.c 2008-08-06 00:41:47.000000000 -0400
-+++ linux-2.6-lttng/ipc/sem.c 2008-08-06 01:04:20.000000000 -0400
-@@ -83,6 +83,7 @@
- #include <linux/rwsem.h>
- #include <linux/nsproxy.h>
- #include <linux/ipc_namespace.h>
-+#include <trace/ipc.h>
-
- #include <asm/uaccess.h>
- #include "util.h"
-@@ -313,6 +314,7 @@ asmlinkage long sys_semget(key_t key, in
- struct ipc_namespace *ns;
- struct ipc_ops sem_ops;
- struct ipc_params sem_params;
-+ long err;
-
- ns = current->nsproxy->ipc_ns;
-
-@@ -327,7 +329,9 @@ asmlinkage long sys_semget(key_t key, in
- sem_params.flg = semflg;
- sem_params.u.nsems = nsems;
-
-- return ipcget(ns, &sem_ids(ns), &sem_ops, &sem_params);
-+ err = ipcget(ns, &sem_ids(ns), &sem_ops, &sem_params);
-+ trace_ipc_sem_create(err, semflg);
-+ return err;
- }
-
- /*
-Index: linux-2.6-lttng/ipc/shm.c
-===================================================================
---- linux-2.6-lttng.orig/ipc/shm.c 2008-08-06 00:41:47.000000000 -0400
-+++ linux-2.6-lttng/ipc/shm.c 2008-08-06 01:04:20.000000000 -0400
-@@ -39,6 +39,7 @@
- #include <linux/nsproxy.h>
- #include <linux/mount.h>
- #include <linux/ipc_namespace.h>
-+#include <trace/ipc.h>
-
- #include <asm/uaccess.h>
-
-@@ -445,6 +446,7 @@ asmlinkage long sys_shmget (key_t key, s
- struct ipc_namespace *ns;
- struct ipc_ops shm_ops;
- struct ipc_params shm_params;
-+ long err;
-
- ns = current->nsproxy->ipc_ns;
-
-@@ -456,7 +458,9 @@ asmlinkage long sys_shmget (key_t key, s
- shm_params.flg = shmflg;
- shm_params.u.size = size;
-
-- return ipcget(ns, &shm_ids(ns), &shm_ops, &shm_params);
-+ err = ipcget(ns, &shm_ids(ns), &shm_ops, &shm_params);
-+ trace_ipc_shm_create(err, shmflg);
-+ return err;
- }
-
- static inline unsigned long copy_shmid_to_user(void __user *buf, struct shmid64_ds *in, int version)
-Index: linux-2.6-lttng/include/trace/ipc.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6-lttng/include/trace/ipc.h 2008-08-06 01:04:20.000000000 -0400
-@@ -0,0 +1,15 @@
-+#ifndef _TRACE_IPC_H
-+#define _TRACE_IPC_H
-+
-+#include <linux/tracepoint.h>
-+
-+DEFINE_TRACE(ipc_msg_create,
-+ TPPROTO(long id, int flags),
-+ TPARGS(id, flags));
-+DEFINE_TRACE(ipc_sem_create,
-+ TPPROTO(long id, int flags),
-+ TPARGS(id, flags));
-+DEFINE_TRACE(ipc_shm_create,
-+ TPPROTO(long id, int flags),
-+ TPARGS(id, flags));
-+#endif