summaryrefslogtreecommitdiff
path: root/tools/perf/util/build-id.c
diff options
context:
space:
mode:
authorDavid Carrillo-Cisneros <davidcc@google.com>2017-07-18 07:25:39 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-07-19 05:14:31 +0300
commitccebbeb6b69e4e172450d32f1059fefd1659ad8c (patch)
tree71f632edf5e5584d8bd2762c8ad606132f5d2a79 /tools/perf/util/build-id.c
parent3b8f51a677ce574f69671e3f7822b4d8f8634ef3 (diff)
downloadlinux-ccebbeb6b69e4e172450d32f1059fefd1659ad8c.tar.xz
perf header: Add struct feat_fd for write
Introduce struct feat_fd. This patch uses it as a wrapper around fd in write_* functions for feature headers. Next patches will extend its functionality to other feature header functions. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros <davidcc@google.com> Acked-by: David Ahern <dsahern@gmail.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: He Kuang <hekuang@huawei.com> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Turner <pjt@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Simon Que <sque@chromium.org> Cc: Stephane Eranian <eranian@google.com> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/r/20170718042549.145161-7-davidcc@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/build-id.c')
-rw-r--r--tools/perf/util/build-id.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index 4baa5329439f..c1a06fcd7e70 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -289,7 +289,7 @@ char *dso__build_id_filename(const struct dso *dso, char *bf, size_t size,
else
static int write_buildid(const char *name, size_t name_len, u8 *build_id,
- pid_t pid, u16 misc, int fd)
+ pid_t pid, u16 misc, struct feat_fd *fd)
{
int err;
struct build_id_event b;
@@ -311,7 +311,8 @@ static int write_buildid(const char *name, size_t name_len, u8 *build_id,
return write_padded(fd, name, name_len + 1, len);
}
-static int machine__write_buildid_table(struct machine *machine, int fd)
+static int machine__write_buildid_table(struct machine *machine,
+ struct feat_fd *fd)
{
int err = 0;
char nm[PATH_MAX];
@@ -356,7 +357,8 @@ static int machine__write_buildid_table(struct machine *machine, int fd)
return err;
}
-int perf_session__write_buildid_table(struct perf_session *session, int fd)
+int perf_session__write_buildid_table(struct perf_session *session,
+ struct feat_fd *fd)
{
struct rb_node *nd;
int err = machine__write_buildid_table(&session->machines.host, fd);