mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: acme@kernel.org
Cc: peterz@infradead.org, mingo@redhat.com,
	alexander.shishkin@linux.intel.com, namhyung@kernel.org,
	adrian.hunter@intel.com, mike.leach@arm.com,
	suzuki.poulosi@arm.com, tor@ti.com, jolsa@redhat.com,
	mathieu.poirier@linaro.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/10] perf tools: Integrating the CoreSight decoding library
Date: Fri, 15 Dec 2017 09:44:50 -0700	[thread overview]
Message-ID: <1513356299-26274-2-git-send-email-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <1513356299-26274-1-git-send-email-mathieu.poirier@linaro.org>

The Open CoreSight Decoding Library (openCSD) is a free and open
library to decode traces collected by the CoreSight hardware
infrastructure.

This patch adds the required mechanic to recognise the presence
of the openCSD library on a system and set up miscellaneous flags
to be used in the compilation of the trace decoding feature.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 tools/build/Makefile.feature          |  6 ++++--
 tools/build/feature/Makefile          |  6 +++++-
 tools/build/feature/test-all.c        |  5 +++++
 tools/build/feature/test-libopencsd.c |  8 ++++++++
 tools/perf/Makefile.config            | 13 +++++++++++++
 5 files changed, 35 insertions(+), 3 deletions(-)
 create mode 100644 tools/build/feature/test-libopencsd.c

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index e52fcefee379..dc3d97b248ab 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -66,7 +66,8 @@ FEATURE_TESTS_BASIC :=                  \
         bpf                             \
         sched_getcpu			\
         sdt				\
-        setns
+        setns				\
+	libopencsd
 
 # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
 # of all feature tests
@@ -108,7 +109,8 @@ FEATURE_DISPLAY ?=              \
          zlib                   \
          lzma                   \
          get_cpuid              \
-         bpf
+         bpf			\
+	 libopencsd
 
 # Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features.
 # If in the future we need per-feature checks/flags for features not
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index cff38f342283..2aae2d3fb5f6 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -52,7 +52,8 @@ FILES=                                          \
          test-cxx.bin                           \
          test-jvmti.bin				\
          test-sched_getcpu.bin			\
-         test-setns.bin
+         test-setns.bin				\
+	 test-libopencsd.bin
 
 FILES := $(addprefix $(OUTPUT),$(FILES))
 
@@ -104,6 +105,9 @@ $(OUTPUT)test-sched_getcpu.bin:
 $(OUTPUT)test-setns.bin:
 	$(BUILD)
 
+$(OUTPUT)test-libopencsd.bin:
+	$(BUILD) -lopencsd_c_api
+
 DWARFLIBS := -ldw
 ifeq ($(findstring -static,${LDFLAGS}),-static)
 DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
index 6fdf83263ab7..38ab0fd7a74c 100644
--- a/tools/build/feature/test-all.c
+++ b/tools/build/feature/test-all.c
@@ -162,6 +162,10 @@
 # include "test-setns.c"
 #undef main
 
+#define main main_test_setns
+# include "test-libopencsd.c"
+#undef main
+
 int main(int argc, char *argv[])
 {
 	main_test_libpython();
@@ -199,6 +203,7 @@ int main(int argc, char *argv[])
 	main_test_sched_getcpu();
 	main_test_sdt();
 	main_test_setns();
+	main_test_libopencsd();
 
 	return 0;
 }
diff --git a/tools/build/feature/test-libopencsd.c b/tools/build/feature/test-libopencsd.c
new file mode 100644
index 000000000000..cd4fb99eb9d3
--- /dev/null
+++ b/tools/build/feature/test-libopencsd.c
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#include <opencsd/c_api/opencsd_c_api.h>
+
+int main(void)
+{
+	(void)ocsd_get_version();
+	return 0;
+}
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 79b117a03fd7..2d0b99f7b4e7 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -346,6 +346,19 @@ ifeq ($(feature-setns), 1)
   $(call detected,CONFIG_SETNS)
 endif
 
+ifeq ($(feature-libopencsd), 1)
+  CFLAGS += -DHAVE_CSTRACE_SUPPORT
+  LIBCSTRACE = -lopencsd_c_api -lopencsd
+  EXTLIBS += $(LIBCSTRACE)
+  $(call detected,CONFIG_LIBOPENCSD)
+  ifdef CSTRACE_RAW
+    CFLAGS += -DCS_DEBUG_RAW
+    ifeq (${CSTRACE_RAW}, packed)
+      CFLAGS += -DCS_RAW_PACKED
+    endif
+  endif
+endif
+
 ifndef NO_LIBELF
   CFLAGS += -DHAVE_LIBELF_SUPPORT
   EXTLIBS += -lelf
-- 
2.7.4

  reply	other threads:[~2017-12-15 16:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15 16:44 [PATCH 00/10] perf tools: Add support for CoreSight trace decoding Mathieu Poirier
2017-12-15 16:44 ` Mathieu Poirier [this message]
2017-12-15 16:44 ` [PATCH 02/10] perf tools: Add initial entry point for decoder CoreSight traces Mathieu Poirier
2017-12-15 16:44 ` [PATCH 03/10] perf tools: Add processing of coresight metadata Mathieu Poirier
2017-12-15 16:44 ` [PATCH 04/10] perf tools: Add decoder mechanic to support dumping trace data Mathieu Poirier
2017-12-15 16:44 ` [PATCH 05/10] perf tools: Add support for decoding CoreSight " Mathieu Poirier
2017-12-30  0:33   ` Leo Yan
2018-01-09 12:09     ` Mike Leach
2018-01-10  5:59       ` Leo Yan
2018-01-10 20:16         ` Mathieu Poirier
2017-12-15 16:44 ` [PATCH 06/10] perf tools: Add functionality to communicate with the openCSD decoder Mathieu Poirier
2017-12-15 16:44 ` [PATCH 07/10] pert tools: Add queue management functionality Mathieu Poirier
2017-12-15 16:44 ` [PATCH 08/10] perf tools: Add full support for CoreSight trace decoding Mathieu Poirier
2017-12-15 16:44 ` [PATCH 09/10] perf tools: Add mechanic to synthesise CoreSight trace packets Mathieu Poirier
2017-12-15 16:44 ` [PATCH 10/10] MAINTAINERS: Adding entry for CoreSight trace decoding Mathieu Poirier
2017-12-30  0:51 ` [PATCH 00/10] perf tools: Add support " Leo Yan
2018-01-08 17:45   ` Mathieu Poirier
2018-01-11  0:08 ` Kim Phillips
2018-01-11 12:23   ` Mark Brown
2018-01-11 15:45     ` Mathieu Poirier
2018-01-11 17:28       ` Kim Phillips
2018-01-11 21:11         ` Mathieu Poirier
2018-01-11 21:49           ` Kim Phillips
2018-01-11 22:18             ` Mathieu Poirier
2018-01-16 12:35               ` Mike Leach
2018-01-16 17:01                 ` Kim Phillips
2018-01-16 17:58                   ` Mathieu Poirier
2018-01-16 19:29                     ` Kim Phillips

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=1513356299-26274-2-git-send-email-mathieu.poirier@linaro.org \
    --to=mathieu.poirier@linaro.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=suzuki.poulosi@arm.com \
    --cc=tor@ti.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

all inboxes | Powered by JetHome®