From: nils.carlson@ericsson.com (Nils Carlson)
Subject: [ltt-dev] [UST PATCH 2/3] Add trace_event library initialisation
Date: Wed, 8 Sep 2010 19:52:20 +0200 [thread overview]
Message-ID: <1283968341-12201-2-git-send-email-nils.carlson@ericsson.com> (raw)
In-Reply-To: <1283968341-12201-1-git-send-email-nils.carlson@ericsson.com>
Add library initialisation with dummy trace_event in order
to create sections.
Signed-off-by: Nils Carlson <nils.carlson at ericsson.com>
---
Makefile.am | 4 ++--
libust-initializer.c | 5 +++++
libust-initializer.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 55 insertions(+), 2 deletions(-)
create mode 100644 libust-initializer.h
diff --git a/Makefile.am b/Makefile.am
index c77ef8f..5132d59 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,7 @@ ACLOCAL_AMFLAGS = -I config
# the linker script.
SUBDIRS = snprintf libustcomm libustcmd libust . tests libustinstr-malloc libustd ustd ustctl libustfork include doc
-EXTRA_DIST = libust.ldscript.in libust-initializer.c
+EXTRA_DIST = libust.ldscript.in libust-initializer.c libust-initializer.h
dist_bin_SCRIPTS = usttrace
ldscriptsdir = $(libdir)
@@ -21,4 +21,4 @@ libust.so: libust.ldscript.in
# It is very important to compile the initializer with PIC otherwise we
# may get obscure errors when linking to shared libraries.
libust-initializer.o: libust-initializer.c
- $(CC) $(CFLAGS) -fno-strict-aliasing -fPIC -c -I$(top_srcdir)/include -o $@ $<
+ $(CC) $(CFLAGS) -fno-strict-aliasing -fPIC -c -I$(top_srcdir)/include -I$(top_srcdir) -o $@ $<
diff --git a/libust-initializer.c b/libust-initializer.c
index 390218e..2ac5637 100644
--- a/libust-initializer.c
+++ b/libust-initializer.c
@@ -21,12 +21,17 @@
DECLARE_TRACE(ust_dummytp, TP_PROTO(int anint), TP_ARGS(anint));
DEFINE_TRACE(ust_dummytp);
+#define CREATE_TRACE_POINTS
+#include "libust-initializer.h"
+
void dummy_libust_initializer_func(void)
{
int i;
trace_mark(ust, dummymark, MARK_NOARGS);
trace_ust_dummytp(i);
+ trace_ust_dummy_event(i);
}
MARKER_LIB;
TRACEPOINT_LIB;
+TRACE_EVENT_LIB;
diff --git a/libust-initializer.h b/libust-initializer.h
new file mode 100644
index 0000000..b5d88ac
--- /dev/null
+++ b/libust-initializer.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 2010 Nils Carlson <nils.carlson at ericsson.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM ust_dummy
+
+#if !defined(_TRACE_EVENT_TEST_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_EVENT_TEST_H
+
+#include <ust/tracepoint.h>
+
+TRACE_EVENT(ust_dummy_event,
+
+ TP_PROTO(int dummy_int),
+
+ TP_ARGS(dummy_int),
+
+ TP_STRUCT__entry(
+ __field( int, dummy )
+ ),
+
+ TP_fast_assign(
+ __entry->dummy = dummy_int;
+ ),
+
+ TP_printf("dummy=%d", __entry->dummy)
+);
+
+#endif /* _TRACE_EVENT_TEST_H */
+
+/* This part must be outside protection */
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_FILE libust-initializer
+#include <ust/define_trace.h>
--
1.7.1
next prev parent reply other threads:[~2010-09-08 17:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-08 17:52 [ltt-dev] [UST PATCH 1/3] Add trace_event structs Nils Carlson
2010-09-08 17:52 ` Nils Carlson [this message]
2010-09-08 17:52 ` [ltt-dev] [UST PATCH 3/3] Add functions and command line for listing trace_events Nils Carlson
2010-09-08 18:23 ` David Goulet
2010-09-09 13:06 [ltt-dev] [UST PATCH 1/3] Add trace_event structs Nils Carlson
2010-09-09 13:06 ` [ltt-dev] [UST PATCH 2/3] Add trace_event library initialisation Nils Carlson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1283968341-12201-2-git-send-email-nils.carlson@ericsson.com \
--to=nils.carlson@ericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox