Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools: Protect header files with a consistent style

There was a colorful mix of header guards - standardize them.

Signed-off-by: John Kacur <jkacur@redhat.com>
LKML-Reference: <alpine.LFD.2.00.0909241756530.11383@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

John Kacur and committed by
Ingo Molnar
8b40f521 cbfeb267

+72 -62
+3 -3
tools/perf/util/cache.h
··· 1 - #ifndef CACHE_H 2 - #define CACHE_H 1 + #ifndef __PERF_CACHE_H 2 + #define __PERF_CACHE_H 3 3 4 4 #include "util.h" 5 5 #include "strbuf.h" ··· 117 117 118 118 extern size_t strlcpy(char *dest, const char *src, size_t size); 119 119 120 - #endif /* CACHE_H */ 120 + #endif /* __PERF_CACHE_H */
+1 -1
tools/perf/util/callchain.h
··· 58 58 int register_callchain_param(struct callchain_param *param); 59 59 void append_chain(struct callchain_node *root, struct ip_callchain *chain, 60 60 struct symbol **syms); 61 - #endif 61 + #endif /* __PERF_CALLCHAIN_H */
+3 -3
tools/perf/util/color.h
··· 1 - #ifndef COLOR_H 2 - #define COLOR_H 1 + #ifndef __PERF_COLOR_H 2 + #define __PERF_COLOR_H 3 3 4 4 /* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */ 5 5 #define COLOR_MAXLEN 24 ··· 39 39 int percent_color_fprintf(FILE *fp, const char *fmt, double percent); 40 40 const char *get_percent_color(double percent); 41 41 42 - #endif /* COLOR_H */ 42 + #endif /* __PERF_COLOR_H */
+4
tools/perf/util/debug.h
··· 1 1 /* For debugging general purposes */ 2 + #ifndef __PERF_DEBUG_H 3 + #define __PERF_DEBUG_H 2 4 3 5 extern int verbose; 4 6 extern int dump_trace; ··· 8 6 int eprintf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); 9 7 int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); 10 8 void trace_event(event_t *event); 9 + 10 + #endif /* __PERF_DEBUG_H */
+2 -1
tools/perf/util/event.h
··· 1 1 #ifndef __PERF_RECORD_H 2 2 #define __PERF_RECORD_H 3 + 3 4 #include "../perf.h" 4 5 #include "util.h" 5 6 #include <linux/list.h> ··· 102 101 int map__overlap(struct map *l, struct map *r); 103 102 size_t map__fprintf(struct map *self, FILE *fp); 104 103 105 - #endif 104 + #endif /* __PERF_RECORD_H */
+3 -3
tools/perf/util/exec_cmd.h
··· 1 - #ifndef PERF_EXEC_CMD_H 2 - #define PERF_EXEC_CMD_H 1 + #ifndef __PERF_EXEC_CMD_H 2 + #define __PERF_EXEC_CMD_H 3 3 4 4 extern void perf_set_argv_exec_path(const char *exec_path); 5 5 extern const char *perf_extract_argv0_path(const char *path); ··· 10 10 extern int execl_perf_cmd(const char *cmd, ...); 11 11 extern const char *system_path(const char *path); 12 12 13 - #endif /* PERF_EXEC_CMD_H */ 13 + #endif /* __PERF_EXEC_CMD_H */
+3 -3
tools/perf/util/header.h
··· 1 - #ifndef _PERF_HEADER_H 2 - #define _PERF_HEADER_H 1 + #ifndef __PERF_HEADER_H 2 + #define __PERF_HEADER_H 3 3 4 4 #include "../../../include/linux/perf_event.h" 5 5 #include <sys/types.h> ··· 44 44 45 45 struct perf_header *perf_header__new(void); 46 46 47 - #endif /* _PERF_HEADER_H */ 47 + #endif /* __PERF_HEADER_H */
+3 -3
tools/perf/util/help.h
··· 1 - #ifndef HELP_H 2 - #define HELP_H 1 + #ifndef __PERF_HELP_H 2 + #define __PERF_HELP_H 3 3 4 4 struct cmdnames { 5 5 size_t alloc; ··· 26 26 void list_commands(const char *title, struct cmdnames *main_cmds, 27 27 struct cmdnames *other_cmds); 28 28 29 - #endif /* HELP_H */ 29 + #endif /* __PERF_HELP_H */
+3 -3
tools/perf/util/levenshtein.h
··· 1 - #ifndef LEVENSHTEIN_H 2 - #define LEVENSHTEIN_H 1 + #ifndef __PERF_LEVENSHTEIN_H 2 + #define __PERF_LEVENSHTEIN_H 3 3 4 4 int levenshtein(const char *string1, const char *string2, 5 5 int swap_penalty, int substition_penalty, 6 6 int insertion_penalty, int deletion_penalty); 7 7 8 - #endif 8 + #endif /* __PERF_LEVENSHTEIN_H */
+3 -3
tools/perf/util/module.h
··· 1 - #ifndef _PERF_MODULE_ 2 - #define _PERF_MODULE_ 1 1 + #ifndef __PERF_MODULE_ 2 + #define __PERF_MODULE_ 1 3 3 4 4 #include <linux/types.h> 5 5 #include "../types.h" ··· 50 50 struct module *mod_dso__find_module(struct mod_dso *self, const char *name); 51 51 int mod_dso__load_modules(struct mod_dso *dso); 52 52 53 - #endif /* _PERF_MODULE_ */ 53 + #endif /* __PERF_MODULE_ */
+3 -3
tools/perf/util/parse-events.h
··· 1 - #ifndef _PARSE_EVENTS_H 2 - #define _PARSE_EVENTS_H 1 + #ifndef __PERF_PARSE_EVENTS_H 2 + #define __PERF_PARSE_EVENTS_H 3 3 /* 4 4 * Parse symbolic events/counts passed in as options: 5 5 */ ··· 31 31 extern int valid_debugfs_mount(const char *debugfs); 32 32 33 33 34 - #endif /* _PARSE_EVENTS_H */ 34 + #endif /* __PERF_PARSE_EVENTS_H */
+3 -3
tools/perf/util/parse-options.h
··· 1 - #ifndef PARSE_OPTIONS_H 2 - #define PARSE_OPTIONS_H 1 + #ifndef __PERF_PARSE_OPTIONS_H 2 + #define __PERF_PARSE_OPTIONS_H 3 3 4 4 enum parse_opt_type { 5 5 /* special types */ ··· 174 174 175 175 extern const char *parse_options_fix_filename(const char *prefix, const char *file); 176 176 177 - #endif 177 + #endif /* __PERF_PARSE_OPTIONS_H */
+3 -3
tools/perf/util/quote.h
··· 1 - #ifndef QUOTE_H 2 - #define QUOTE_H 1 + #ifndef __PERF_QUOTE_H 2 + #define __PERF_QUOTE_H 3 3 4 4 #include <stddef.h> 5 5 #include <stdio.h> ··· 65 65 extern void python_quote_print(FILE *stream, const char *src); 66 66 extern void tcl_quote_print(FILE *stream, const char *src); 67 67 68 - #endif 68 + #endif /* __PERF_QUOTE_H */
+3 -3
tools/perf/util/run-command.h
··· 1 - #ifndef RUN_COMMAND_H 2 - #define RUN_COMMAND_H 1 + #ifndef __PERF_RUN_COMMAND_H 2 + #define __PERF_RUN_COMMAND_H 3 3 4 4 enum { 5 5 ERR_RUN_COMMAND_FORK = 10000, ··· 85 85 int start_async(struct async *async); 86 86 int finish_async(struct async *async); 87 87 88 - #endif 88 + #endif /* __PERF_RUN_COMMAND_H */
+3 -3
tools/perf/util/sigchain.h
··· 1 - #ifndef SIGCHAIN_H 2 - #define SIGCHAIN_H 1 + #ifndef __PERF_SIGCHAIN_H 2 + #define __PERF_SIGCHAIN_H 3 3 4 4 typedef void (*sigchain_fun)(int); 5 5 ··· 8 8 9 9 void sigchain_push_common(sigchain_fun f); 10 10 11 - #endif /* SIGCHAIN_H */ 11 + #endif /* __PERF_SIGCHAIN_H */
+3 -3
tools/perf/util/strbuf.h
··· 1 - #ifndef STRBUF_H 2 - #define STRBUF_H 1 + #ifndef __PERF_STRBUF_H 2 + #define __PERF_STRBUF_H 3 3 4 4 /* 5 5 * Strbuf's can be use in many ways: as a byte array, or to store arbitrary ··· 134 134 extern int strbuf_branchname(struct strbuf *sb, const char *name); 135 135 extern int strbuf_check_branch_ref(struct strbuf *sb, const char *name); 136 136 137 - #endif /* STRBUF_H */ 137 + #endif /* __PERF_STRBUF_H */
+3 -3
tools/perf/util/string.h
··· 1 - #ifndef _PERF_STRING_H_ 2 - #define _PERF_STRING_H_ 1 + #ifndef __PERF_STRING_H_ 2 + #define __PERF_STRING_H_ 3 3 4 4 #include "types.h" 5 5 ··· 8 8 #define _STR(x) #x 9 9 #define STR(x) _STR(x) 10 10 11 - #endif 11 + #endif /* __PERF_STRING_H */
+3 -3
tools/perf/util/strlist.h
··· 1 - #ifndef STRLIST_H_ 2 - #define STRLIST_H_ 1 + #ifndef __PERF_STRLIST_H 2 + #define __PERF_STRLIST_H 3 3 4 4 #include <linux/rbtree.h> 5 5 #include <stdbool.h> ··· 36 36 } 37 37 38 38 int strlist__parse_list(struct strlist *self, const char *s); 39 - #endif /* STRLIST_H_ */ 39 + #endif /* __PERF_STRLIST_H */
+3 -3
tools/perf/util/svghelper.h
··· 1 - #ifndef _INCLUDE_GUARD_SVG_HELPER_ 2 - #define _INCLUDE_GUARD_SVG_HELPER_ 1 + #ifndef __PERF_SVGHELPER_H 2 + #define __PERF_SVGHELPER_H 3 3 4 4 #include "types.h" 5 5 ··· 25 25 26 26 extern int svg_page_width; 27 27 28 - #endif 28 + #endif /* __PERF_SVGHELPER_H */
+3 -3
tools/perf/util/symbol.h
··· 1 - #ifndef _PERF_SYMBOL_ 2 - #define _PERF_SYMBOL_ 1 1 + #ifndef __PERF_SYMBOL 2 + #define __PERF_SYMBOL 1 3 3 4 4 #include <linux/types.h> 5 5 #include "types.h" ··· 89 89 extern struct dso *hypervisor_dso; 90 90 extern const char *vmlinux_name; 91 91 extern int modules; 92 - #endif /* _PERF_SYMBOL_ */ 92 + #endif /* __PERF_SYMBOL */
+5
tools/perf/util/thread.h
··· 1 + #ifndef __PERF_THREAD_H 2 + #define __PERF_THREAD_H 3 + 1 4 #include <linux/rbtree.h> 2 5 #include <linux/list.h> 3 6 #include <unistd.h> ··· 23 20 int thread__fork(struct thread *self, struct thread *parent); 24 21 struct map *thread__find_map(struct thread *self, u64 ip); 25 22 size_t threads__fprintf(FILE *fp, struct rb_root *threads); 23 + 24 + #endif /* __PERF_THREAD_H */
+3 -3
tools/perf/util/trace-event.h
··· 1 - #ifndef _TRACE_EVENTS_H 2 - #define _TRACE_EVENTS_H 1 + #ifndef __PERF_TRACE_EVENTS_H 2 + #define __PERF_TRACE_EVENTS_H 3 3 4 4 #include "parse-events.h" 5 5 ··· 242 242 243 243 void read_tracing_data(struct perf_event_attr *pattrs, int nb_events); 244 244 245 - #endif /* _TRACE_EVENTS_H */ 245 + #endif /* __PERF_TRACE_EVENTS_H */
+3 -3
tools/perf/util/types.h
··· 1 - #ifndef _PERF_TYPES_H 2 - #define _PERF_TYPES_H 1 + #ifndef __PERF_TYPES_H 2 + #define __PERF_TYPES_H 3 3 4 4 /* 5 5 * We define u64 as unsigned long long for every architecture ··· 14 14 typedef unsigned char u8; 15 15 typedef signed char s8; 16 16 17 - #endif /* _PERF_TYPES_H */ 17 + #endif /* __PERF_TYPES_H */
+3 -3
tools/perf/util/values.h
··· 1 - #ifndef _PERF_VALUES_H 2 - #define _PERF_VALUES_H 1 + #ifndef __PERF_VALUES_H 2 + #define __PERF_VALUES_H 3 3 4 4 #include "types.h" 5 5 ··· 24 24 void perf_read_values_display(FILE *fp, struct perf_read_values *values, 25 25 int raw); 26 26 27 - #endif /* _PERF_VALUES_H */ 27 + #endif /* __PERF_VALUES_H */