Skip to contentSkip to conversation

perf tools: Move sane ctype stuff from util.h to sane_ctype.h

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Apr 20, 2017 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  3d689ed6099a1a11c38bb78aff7498e78e287e0b
Gitweb:     http://git.kernel.org/tip/3d689ed6099a1a11c38bb78aff7498e78e287e0b
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Mon, 17 Apr 2017 16:10:49 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 19 Apr 2017 13:01:48 -0300

perf tools: Move sane ctype stuff from util.h to sane_ctype.h

More stuff that came from git, out of the hodge-podge that is util.h

---
 tools/lib/symbol/kallsyms.c         |  1 +
 tools/perf/arch/common.c            |  2 ++
 tools/perf/builtin-kmem.c           |  2 ++
 tools/perf/builtin-sched.c          |  2 ++
 tools/perf/builtin-script.c         |  2 ++
 tools/perf/builtin-stat.c           |  2 ++
 tools/perf/builtin-top.c            |  2 ++
 tools/perf/builtin-trace.c          |  2 ++
 tools/perf/tests/code-reading.c     |  3 ++-
 tools/perf/ui/browser.c             |  1 +
 tools/perf/ui/browsers/hists.c      |  2 ++
 tools/perf/ui/browsers/map.c        |  2 ++
 tools/perf/ui/stdio/hist.c          |  2 +-
 tools/perf/util/annotate.c          |  2 ++
 tools/perf/util/auxtrace.c          |  5 ++--
 tools/perf/util/build-id.c          |  1 +
 tools/perf/util/config.c            |  2 ++
 tools/perf/util/cpumap.c            |  2 ++
 tools/perf/util/ctype.c             |  2 +-
 tools/perf/util/data-convert-bt.c   |  1 +
 tools/perf/util/debug.c             |  2 ++
 tools/perf/util/demangle-java.c     |  2 ++
 tools/perf/util/event.c             |  1 +
 tools/perf/util/evsel.c             |  2 ++
 tools/perf/util/header.c            |  2 ++
 tools/perf/util/jitdump.c           |  2 ++
 tools/perf/util/machine.c           |  4 ++-
 tools/perf/util/probe-event.c       |  2 ++
 tools/perf/util/probe-finder.h      |  2 +-
 tools/perf/util/sane_ctype.h        | 51 +++++++++++++++++++++++++++++++++++++
 tools/perf/util/strfilter.c         |  2 ++
 tools/perf/util/string.c            |  2 ++
 tools/perf/util/symbol-elf.c        |  3 ++-
 tools/perf/util/symbol.c            |  1 +
 tools/perf/util/trace-event-parse.c |  3 ++-
 tools/perf/util/util.c              |  2 ++
 tools/perf/util/util.h              | 46 ---------------------------------
 37 files changed, 114 insertions(+), 55 deletions(-)
tools/lib/symbol/kallsyms.c +1 -0
index 5e43107..d270ac0 100644
@@ -1,3 +1,4 @@
+#include <ctype.h>
 #include "symbol/kallsyms.h"
 #include <stdio.h>
 #include <stdlib.h>
tools/perf/arch/common.c +2 -0
index 886dd2a..837067f 100644
@@ -4,6 +4,8 @@
 #include "../util/util.h"
 #include "../util/debug.h"
 
+#include "sane_ctype.h"
+
 const char *const arm_triplets[] = {
 	"arm-eabi-",
 	"arm-linux-androideabi-",
tools/perf/builtin-kmem.c +2 -0
index fa6bf1c..15754a4 100644
@@ -27,6 +27,8 @@
 #include <locale.h>
 #include <regex.h>
 
+#include "sane_ctype.h"
+
 static int	kmem_slab;
 static int	kmem_page;
 
tools/perf/builtin-sched.c +2 -0
index d4677fb..aefab93 100644
@@ -34,6 +34,8 @@
 #include <api/fs/fs.h>
 #include <linux/time64.h>
 
+#include "sane_ctype.h"
+
 #define PR_SET_NAME		15               /* Set process name */
 #define MAX_CPUS		4096
 #define COMM_LEN		20
tools/perf/builtin-script.c +2 -0
index c4e36b4..5afd9a6 100644
@@ -32,6 +32,8 @@
 #include "util/dump-insn.h"
 #include <inttypes.h>
 
+#include "sane_ctype.h"
+
 static char const		*script_name;
 static char const		*generate_script_lang;
 static bool			debug_mode;
tools/perf/builtin-stat.c +2 -0
index b7199f0..5abef25 100644
@@ -74,6 +74,8 @@
 #include <locale.h>
 #include <math.h>
 
+#include "sane_ctype.h"
+
 #define DEFAULT_SEPARATOR	" "
 #define CNTR_NOT_SUPPORTED	"<not supported>"
 #define CNTR_NOT_COUNTED	"<not counted>"
tools/perf/builtin-top.c +2 -0
index a0c97c7..ec3247d 100644
@@ -72,6 +72,8 @@
 #include <linux/time64.h>
 #include <linux/types.h>
 
+#include "sane_ctype.h"
+
 static volatile int done;
 
 #define HEADER_LINE_NR  5
tools/perf/builtin-trace.c +2 -0
index aba5fac..0b00d8a 100644
@@ -51,6 +51,8 @@
 #include <linux/stringify.h>
 #include <linux/time64.h>
 
+#include "sane_ctype.h"
+
 #ifndef O_CLOEXEC
 # define O_CLOEXEC		02000000
 #endif
tools/perf/tests/code-reading.c +2 -1
index 6effcfb..fe6aac8 100644
@@ -4,7 +4,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
-#include <ctype.h>
 #include <string.h>
 
 #include "parse-events.h"
@@ -18,6 +17,8 @@
 
 #include "tests.h"
 
+#include "sane_ctype.h"
+
 #define BUFSZ	1024
 #define READLEN	128
 
tools/perf/ui/browser.c +1 -0
index 9e47ccb..73bdd07 100644
@@ -13,6 +13,7 @@
 #include "helpline.h"
 #include "keysyms.h"
 #include "../color.h"
+#include "sane_ctype.h"
 
 static int ui_browser__percent_color(struct ui_browser *browser,
 				     double percent, bool current)
tools/perf/ui/browsers/hists.c +2 -0
index a2ea1fa..56f5c03 100644
@@ -20,6 +20,8 @@
 #include "map.h"
 #include "annotate.h"
 
+#include "sane_ctype.h"
+
 extern void hist_browser__init_hpp(void);
 
 static int perf_evsel_browser_title(struct hist_browser *browser,
tools/perf/ui/browsers/map.c +2 -0
index 9ce142d..ffa5add 100644
@@ -11,6 +11,8 @@
 #include "../keysyms.h"
 #include "map.h"
 
+#include "sane_ctype.h"
+
 struct map_browser {
 	struct ui_browser b;
 	struct map	  *map;
tools/perf/ui/stdio/hist.c +1 -1
index d52d5f6..297a79c 100644
@@ -4,7 +4,7 @@
 #include "../../util/hist.h"
 #include "../../util/sort.h"
 #include "../../util/evsel.h"
-
+#include "../../util/sane_ctype.h"
 
 static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin)
 {
tools/perf/util/annotate.c +2 -0
index 4d4faf9..d69fdaf 100644
@@ -26,6 +26,8 @@
 #include <linux/kernel.h>
 #include <sys/utsname.h>
 
+#include "sane_ctype.h"
+
 const char 	*disassembler_style;
 const char	*objdump_path;
 static regex_t	 file_lineno;
tools/perf/util/auxtrace.c +3 -2
index a81a402..0daf63b 100644
@@ -17,7 +17,6 @@
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <stdbool.h>
-#include <ctype.h>
 #include <string.h>
 #include <limits.h>
 #include <errno.h>
@@ -47,7 +46,6 @@
 #include "cpumap.h"
 #include "thread_map.h"
 #include "asm/bug.h"
-#include "symbol/kallsyms.h"
 #include "auxtrace.h"
 
 #include <linux/hash.h>
@@ -60,6 +58,9 @@
 #include "intel-pt.h"
 #include "intel-bts.h"
 
+#include "sane_ctype.h"
+#include "symbol/kallsyms.h"
+
 int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
 			struct auxtrace_mmap_params *mp,
 			void *userpg, int fd)
tools/perf/util/build-id.c +1 -0
index 33af675..3c07555 100644
@@ -19,6 +19,7 @@
 #include "vdso.h"
 #include "probe-file.h"
 
+#include "sane_ctype.h"
 
 static bool no_buildid_cache;
 
tools/perf/util/config.c +2 -0
index 7b01d59..88783aa 100644
@@ -15,6 +15,8 @@
 #include "util/llvm-utils.h"   /* perf_llvm_config */
 #include "config.h"
 
+#include "sane_ctype.h"
+
 #define MAXNAME (256)
 
 #define DEBUG_CACHE_DIR ".debug"
tools/perf/util/cpumap.c +2 -0
index 061018b..9d9ecb2 100644
@@ -8,6 +8,8 @@
 #include <linux/bitmap.h>
 #include "asm/bug.h"
 
+#include "sane_ctype.h"
+
 static int max_cpu_num;
 static int max_present_cpu_num;
 static int max_node_num;
tools/perf/util/ctype.c +1 -1
index d4a5a21..4b261c2 100644
@@ -3,7 +3,7 @@
  *
  * No surprises, and works with signed and unsigned chars.
  */
-#include "util.h"
+#include "sane_ctype.h"
 
 enum {
 	S = GIT_SPACE,
tools/perf/util/data-convert-bt.c +1 -0
index ef80221..c3277b3 100644
@@ -29,6 +29,7 @@
 #include "evsel.h"
 #include "machine.h"
 #include "config.h"
+#include "sane_ctype.h"
 
 #define pr_N(n, fmt, ...) \
 	eprintf(n, debug_data_convert, fmt, ##__VA_ARGS__)
tools/perf/util/debug.c +2 -0
index 4d5df25..41aa7c6 100644
@@ -16,6 +16,8 @@
 #include "util.h"
 #include "target.h"
 
+#include "sane_ctype.h"
+
 int verbose;
 bool dump_trace = false, quiet = false;
 int debug_ordered_events;
tools/perf/util/demangle-java.c +2 -0
index 3e6062a..cb66d33 100644
@@ -7,6 +7,8 @@
 
 #include "demangle-java.h"
 
+#include "sane_ctype.h"
+
 enum {
 	MODE_PREFIX = 0,
 	MODE_CLASS  = 1,
tools/perf/util/event.c +1 -0
index b761b0e..f8a706b 100644
@@ -12,6 +12,7 @@
 #include "strlist.h"
 #include "thread.h"
 #include "thread_map.h"
+#include "sane_ctype.h"
 #include "symbol/kallsyms.h"
 #include "asm/bug.h"
 #include "stat.h"
tools/perf/util/evsel.c +2 -0
index 99a13a6..757f73c 100644
@@ -31,6 +31,8 @@
 #include "stat.h"
 #include "util/parse-branch-options.h"
 
+#include "sane_ctype.h"
+
 static struct {
 	bool sample_id_all;
 	bool exclude_guest;
tools/perf/util/header.c +2 -0
index 0371f34..faf046f 100644
@@ -27,6 +27,8 @@
 #include <api/fs/fs.h>
 #include "asm/bug.h"
 
+#include "sane_ctype.h"
+
 /*
  * magic2 = "PERFILE2"
  * must be a numerical value to let the endianness
tools/perf/util/jitdump.c +2 -0
index da6262d..d6d2532 100644
@@ -26,6 +26,8 @@
 #include "genelf.h"
 #include "../builtin.h"
 
+#include "sane_ctype.h"
+
 struct jit_buf_desc {
 	struct perf_data_file *output;
 	struct perf_session *session;
tools/perf/util/machine.c +3 -1
index 15b2a17c..f13f46a 100644
@@ -11,11 +11,13 @@
 #include "thread.h"
 #include "vdso.h"
 #include <stdbool.h>
-#include <symbol/kallsyms.h>
 #include "unwind.h"
 #include "linux/hash.h"
 #include "asm/bug.h"
 
+#include "sane_ctype.h"
+#include <symbol/kallsyms.h>
+
 static void __machine__remove_thread(struct machine *machine, struct thread *th, bool lock);
 
 static void dsos__init(struct dsos *dsos)
tools/perf/util/probe-event.c +2 -0
index e61b4b3..7caba70 100644
@@ -48,6 +48,8 @@
 #include "probe-file.h"
 #include "session.h"
 
+#include "sane_ctype.h"
+
 #define PERFPROBE_GROUP "probe"
 
 bool probe_event_dry_run;	/* Dry run flag */
tools/perf/util/probe-finder.h +1 -1
index 2956c51..27f0615 100644
@@ -2,9 +2,9 @@
 #define _PROBE_FINDER_H
 
 #include <stdbool.h>
-#include "util.h"
 #include "intlist.h"
 #include "probe-event.h"
+#include "sane_ctype.h"
 
 #define MAX_PROBE_BUFFER	1024
 #define MAX_PROBES		 128
tools/perf/util/sane_ctype.h new file +51 -0

51 lines not on this page · raw message

tools/perf/util/strfilter.c +2 -0
index efb5377..c663c91 100644
@@ -2,6 +2,8 @@
 #include "string.h"
 #include "strfilter.h"
 
+#include "sane_ctype.h"
+
 /* Operators */
 static const char *OP_and	= "&";	/* Logical AND */
 static const char *OP_or	= "|";	/* Logical OR */
tools/perf/util/string.c +2 -0
index e8feb14..e716a6e 100644
@@ -1,6 +1,8 @@
 #include "util.h"
 #include "linux/string.h"
 
+#include "sane_ctype.h"
+
 #define K 1024LL
 /*
  * perf_atoll()
tools/perf/util/symbol-elf.c +2 -1
index d1a40bb..e7ee47f 100644
@@ -10,8 +10,9 @@
 #include "demangle-rust.h"
 #include "machine.h"
 #include "vdso.h"
-#include <symbol/kallsyms.h>
 #include "debug.h"
+#include "sane_ctype.h"
+#include <symbol/kallsyms.h>
 
 #ifndef EM_AARCH64
 #define EM_AARCH64	183  /* ARM 64 bit */
tools/perf/util/symbol.c +1 -0
index 619e3eb..68f14d7 100644
@@ -19,6 +19,7 @@
 #include "strlist.h"
 #include "intlist.h"
 #include "header.h"
+#include "sane_ctype.h"
 
 #include <elf.h>
 #include <limits.h>
tools/perf/util/trace-event-parse.c +2 -1
index de0078e..746bbee 100644
@@ -21,13 +21,14 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
 #include <errno.h>
 
 #include "../perf.h"
 #include "util.h"
 #include "trace-event.h"
 
+#include "sane_ctype.h"
+
 static int get_common_field(struct scripting_context *context,
 			    int *offset, int *size, const char *type)
 {
tools/perf/util/util.c +2 -0
index 524bd3b..717541e 100644
@@ -21,6 +21,8 @@
 #include "callchain.h"
 #include "strlist.h"
 
+#include "sane_ctype.h"
+
 #define CALLCHAIN_PARAM_DEFAULT			\
 	.mode		= CHAIN_GRAPH_ABS,	\
 	.min_percent	= 0.5,			\
tools/perf/util/util.h +0 -46

58 lines not on this page · raw message