Skip to content

Commit cd0cfad

Browse files
suryasaimadhuacmel
authored andcommitted
perf tools: Move fs.* to lib/api/fs/
Move to generic library and kill magic.h as it is needed only in fs.h. Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Robert Richter <rric@kernel.org> Cc: Stanislav Fomichev <stfomichev@yandex-team.ru> Cc: Stephane Eranian <eranian@google.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386605664-24041-3-git-send-email-bp@alien8.de Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent c9b951c commit cd0cfad

11 files changed

Lines changed: 21 additions & 26 deletions

File tree

‎tools/lib/api/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ LIB_H=
99
LIB_OBJS=
1010

1111
LIB_H += fs/debugfs.h
12+
LIB_H += fs/fs.h
1213

1314
LIB_OBJS += $(OUTPUT)fs/debugfs.o
15+
LIB_OBJS += $(OUTPUT)fs/fs.o
1416

1517
LIBFILE = libapikfs.a
1618

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
/* TODO merge/factor in debugfs.c here */
12

2-
/* TODO merge/factor into tools/lib/lk/debugfs.c */
3+
#include <errno.h>
4+
#include <stdbool.h>
5+
#include <stdio.h>
6+
#include <string.h>
7+
#include <sys/vfs.h>
38

4-
#include "util.h"
5-
#include "util/fs.h"
9+
#include "debugfs.h"
10+
#include "fs.h"
611

712
static const char * const sysfs__fs_known_mountpoints[] = {
813
"/sys",
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#ifndef _PERF_LINUX_MAGIC_H_
2-
#define _PERF_LINUX_MAGIC_H_
3-
4-
#ifndef DEBUGFS_MAGIC
5-
#define DEBUGFS_MAGIC 0x64626720
6-
#endif
1+
#ifndef __API_FS__
2+
#define __API_FS__
73

84
#ifndef SYSFS_MAGIC
95
#define SYSFS_MAGIC 0x62656572
@@ -13,4 +9,6 @@
139
#define PROC_SUPER_MAGIC 0x9fa0
1410
#endif
1511

16-
#endif
12+
const char *sysfs__mountpoint(void);
13+
const char *procfs__mountpoint(void);
14+
#endif /* __API_FS__ */

‎tools/perf/Makefile.perf‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ LIB_H += util/include/linux/ctype.h
218218
LIB_H += util/include/linux/kernel.h
219219
LIB_H += util/include/linux/list.h
220220
LIB_H += util/include/linux/export.h
221-
LIB_H += util/include/linux/magic.h
222221
LIB_H += util/include/linux/poison.h
223222
LIB_H += util/include/linux/prefetch.h
224223
LIB_H += util/include/linux/rbtree.h
@@ -244,7 +243,6 @@ LIB_H += util/cache.h
244243
LIB_H += util/callchain.h
245244
LIB_H += util/build-id.h
246245
LIB_H += util/debug.h
247-
LIB_H += util/fs.h
248246
LIB_H += util/pmu.h
249247
LIB_H += util/event.h
250248
LIB_H += util/evsel.h
@@ -306,7 +304,6 @@ LIB_OBJS += $(OUTPUT)util/annotate.o
306304
LIB_OBJS += $(OUTPUT)util/build-id.o
307305
LIB_OBJS += $(OUTPUT)util/config.o
308306
LIB_OBJS += $(OUTPUT)util/ctype.o
309-
LIB_OBJS += $(OUTPUT)util/fs.o
310307
LIB_OBJS += $(OUTPUT)util/pmu.o
311308
LIB_OBJS += $(OUTPUT)util/environment.o
312309
LIB_OBJS += $(OUTPUT)util/event.o

‎tools/perf/tests/parse-events.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "parse-events.h"
33
#include "evsel.h"
44
#include "evlist.h"
5-
#include "fs.h"
5+
#include <api/fs/fs.h>
66
#include <api/fs/debugfs.h>
77
#include "tests.h"
88
#include <linux/hw_breakpoint.h>

‎tools/perf/util/cpumap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "util.h"
2-
#include "fs.h"
2+
#include <api/fs/fs.h>
33
#include "../perf.h"
44
#include "cpumap.h"
55
#include <assert.h>

‎tools/perf/util/fs.h‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎tools/perf/util/pmu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <unistd.h>
44
#include <stdio.h>
55
#include <dirent.h>
6-
#include "fs.h"
6+
#include <api/fs/fs.h>
77
#include <locale.h>
88
#include "util.h"
99
#include "pmu.h"

‎tools/perf/util/python-ext-sources‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ util/xyarray.c
1717
util/cgroup.c
1818
util/rblist.c
1919
util/strlist.c
20-
util/fs.c
20+
../lib/api/fs/fs.c
2121
util/trace-event.c
2222
../../lib/rbtree.c

‎tools/perf/util/record.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "evsel.h"
33
#include "cpumap.h"
44
#include "parse-events.h"
5-
#include "fs.h"
5+
#include <api/fs/fs.h>
66
#include "util.h"
77

88
typedef void (*setup_probe_fn_t)(struct perf_evsel *evsel);

0 commit comments

Comments
 (0)