mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, peterz@infradead.org, fweisbec@gmail.com,
	David Ahern <dsahern@gmail.com>
Subject: [PATCH 1/9] perf python: add ui stubs file
Date: Mon, 29 Oct 2012 10:31:41 -0600	[thread overview]
Message-ID: <1351528309-87705-2-git-send-email-dsahern@gmail.com> (raw)
In-Reply-To: <1351528309-87705-1-git-send-email-dsahern@gmail.com>

stdio based implementations of ui_xxxx based functions for the python
library. Needed for patch 3 - consolidating open counters method.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
---
 tools/perf/util/python-ext-sources |    1 +
 tools/perf/util/python_stubs.c     |   54 ++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)
 create mode 100644 tools/perf/util/python_stubs.c

diff --git a/tools/perf/util/python-ext-sources b/tools/perf/util/python-ext-sources
index c40c2d3..92d9e05 100644
--- a/tools/perf/util/python-ext-sources
+++ b/tools/perf/util/python-ext-sources
@@ -19,3 +19,4 @@ util/debugfs.c
 util/rblist.c
 util/strlist.c
 ../../lib/rbtree.c
+util/python_stubs.c
diff --git a/tools/perf/util/python_stubs.c b/tools/perf/util/python_stubs.c
new file mode 100644
index 0000000..7b31880
--- /dev/null
+++ b/tools/perf/util/python_stubs.c
@@ -0,0 +1,54 @@
+/*
+ * stubs for various ui-specific functions for the python library
+ */
+
+#include <stdio.h>
+#include "debug.h"
+
+#if !defined(NEWT_SUPPORT) && !defined(GTK2_SUPPORT)
+#undef ui__error
+#endif
+
+int verbose;
+
+int ui__warning(const char *format, ...)
+{
+	va_list args;
+
+	va_start(args, format);
+	vfprintf(stderr, format, args);
+	va_end(args);
+	return 0;
+}
+
+int ui__error(const char *format, ...)
+{
+	va_list args;
+
+	va_start(args, format);
+	vfprintf(stderr, format, args);
+	va_end(args);
+	return 0;
+}
+
+int ui__error_paranoid(void)
+{
+	return ui__error("Permission error - are you root?\n"
+			 "Consider tweaking /proc/sys/kernel/perf_event_paranoid:\n"
+			 " -1 - Not paranoid at all\n"
+			 "  0 - Disallow raw tracepoint access for unpriv\n"
+			 "  1 - Disallow cpu events for unpriv\n"
+			 "  2 - Disallow kernel profiling for unpriv\n");
+}
+
+int eprintf(int level, const char *fmt, ...)
+{
+	va_list args;
+	int ret = 0;
+
+	va_start(args, fmt);
+	ret = vfprintf(stderr, fmt, args);
+	va_end(args);
+
+	return ret;
+}
-- 
1.7.10.1


  reply	other threads:[~2012-10-29 16:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29 16:31 [PATCH 0/9 v2] perf: consolidate all the open counters loops David Ahern
2012-10-29 16:31 ` David Ahern [this message]
2012-10-30  7:24   ` [PATCH 1/9] perf python: add ui stubs file Namhyung Kim
2012-10-30 14:45     ` David Ahern
2012-10-30 15:53       ` Arnaldo Carvalho de Melo
2012-10-31  7:18         ` Namhyung Kim
2012-10-29 16:31 ` [PATCH 2/9] perf top: make use of perf_record_opts David Ahern
2012-10-30  7:27   ` Namhyung Kim
2012-10-30 13:31     ` David Ahern
2012-10-29 16:31 ` [PATCH 3/9] perf evlist: introduce open counters method David Ahern
2012-10-29 16:31 ` [PATCH 4/9] perf top: use the new perf_evlist__open_counters method David Ahern
2012-10-29 16:31 ` [PATCH 5/9] perf record: " David Ahern
2012-10-29 16:31 ` [PATCH 6/9] perf stat: move user options to perf_record_opts David Ahern
2012-10-29 16:31 ` [PATCH 7/9] perf evlist: add stat unique code to open_counters method David Ahern
2012-10-29 16:31 ` [PATCH 8/9] perf stat: move to perf_evlist__open_counters David Ahern
2012-10-29 16:31 ` [PATCH 9/9] perf evsel: remove perf_evsel__open_per_cpu David Ahern
  -- strict thread matches above, loose matches on Subject: below --
2012-10-11  4:25 [PATCH 0/9] perf: consolidate all the open counters loops David Ahern
2012-10-11  4:25 ` [PATCH 1/9] perf python: add ui stubs file David Ahern

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=1351528309-87705-2-git-send-email-dsahern@gmail.com \
    --to=dsahern@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /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

Powered by JetHome