summaryrefslogtreecommitdiffstats
path: root/tools/include/linux
diff options
context:
space:
mode:
authorIngo Molnar2016-07-13 08:50:54 +0200
committerIngo Molnar2016-07-13 08:50:54 +0200
commit68cf16c6b8b4ed818bb6211e1975fd75b78c7e86 (patch)
tree46994b044d96741a2c4723a27e8a7f70487b4107 /tools/include/linux
parentRevert "perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86" (diff)
parenttools lib traceevent: Add filter on task CPU id (diff)
downloadkernel-qcow2-linux-68cf16c6b8b4ed818bb6211e1975fd75b78c7e86.tar.gz
kernel-qcow2-linux-68cf16c6b8b4ed818bb6211e1975fd75b78c7e86.tar.xz
kernel-qcow2-linux-68cf16c6b8b4ed818bb6211e1975fd75b78c7e86.zip
Merge tag 'perf-core-for-mingo-20160712' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: User visible changes: - Add demangling of symbols in programs written in the Rust language (David Tolnay) - Add support for tracepoints in the python binding, including an example, that sets up and parses sched:sched_switch events, tools/perf/python/tracepoint.py (Jiri Olsa) - Introduce --stdio-color to set up the color output mode selection in 'annotate' and 'report', allowing emit color escape sequences when redirecting the output of these tools (Arnaldo Carvalho de Melo) Infrastructure changes: - Various tweaks to allow the 'perf trace' beautifiers to build without using kernel headers and in a wider range of Linux distributions/releases (Arnaldo Carvalho de Melo) - Stop using kernel source files, instead copy what is needed and check when the original kernel source file gets modified, warning the developers about it. This helps in building the tool in older systems and even in recent ones, for just added kernel features for which ABI details (struct changes, defines, etc) still are not available on system headers (Arnaldo Carvalho de Melo) - Be consistent in how to use strerror_r, adding a wrapper that makes sure that it returns a pointer to passed buffer, and using the XSI variant, that is available in more libc implementations (Arnaldo Carvalho de Melo) - Avoid checking code drift on busibox's diff perf intel-pt-decoder, as it doesn't have the '-I' command line switch to check for regexps (Arnaldo Carvalho de Melo) - Add missing headers in various places (Arnaldo Carvalho de Melo) - Remove unneeded headers from various other places (Arnaldo Carvalho de Melo) - Add feature detection for gelf_getnote(), disabling SDT support if not present (Arnaldo Carvalho de Melo) - Fix oddities with GCC 5.3.0 by initializing some variables (Arnaldo Carvalho de Melo) - With those changes in place perf now builds on Alpine Linux 3.4, in addition to on centos (5, 6, 7), debian (7, 8, experimental), fedora (21, 22, 23, 24, rawhide), mageia 5, opensuse (13.2, 42.1) and ubuntu (12.04.5, 14.04.4, 15.10, 16.04) and will be test build on those systems prior to future pull requests. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/include/linux')
-rw-r--r--tools/include/linux/kernel.h28
-rw-r--r--tools/include/linux/string.h4
2 files changed, 6 insertions, 26 deletions
diff --git a/tools/include/linux/kernel.h b/tools/include/linux/kernel.h
index 76df53539c2a..28607db02bd3 100644
--- a/tools/include/linux/kernel.h
+++ b/tools/include/linux/kernel.h
@@ -2,8 +2,7 @@
#define __TOOLS_LINUX_KERNEL_H
#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <stddef.h>
#include <assert.h>
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
@@ -70,29 +69,8 @@
#define cpu_to_le64(x) (x)
#define cpu_to_le32(x) (x)
-static inline int
-vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
-{
- int i;
- ssize_t ssize = size;
-
- i = vsnprintf(buf, size, fmt, args);
-
- return (i >= ssize) ? (ssize - 1) : i;
-}
-
-static inline int scnprintf(char * buf, size_t size, const char * fmt, ...)
-{
- va_list args;
- ssize_t ssize = size;
- int i;
-
- va_start(args, fmt);
- i = vsnprintf(buf, size, fmt, args);
- va_end(args);
-
- return (i >= ssize) ? (ssize - 1) : i;
-}
+int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
+int scnprintf(char * buf, size_t size, const char * fmt, ...);
/*
* This looks more complex than it should be. But we need to
diff --git a/tools/include/linux/string.h b/tools/include/linux/string.h
index e26223f1f287..b96879477311 100644
--- a/tools/include/linux/string.h
+++ b/tools/include/linux/string.h
@@ -8,8 +8,10 @@ void *memdup(const void *src, size_t len);
int strtobool(const char *s, bool *res);
-#ifndef __UCLIBC__
+#ifdef __GLIBC__
extern size_t strlcpy(char *dest, const char *src, size_t size);
#endif
+char *str_error_r(int errnum, char *buf, size_t buflen);
+
#endif /* _LINUX_STRING_H_ */