perf tools: Add struct perf_data_file

Add struct perf_data_file to represent a single file within a perf_data
struct.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Changbin Du <changbin.du@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-c3f9p4xzykr845ktqcek6p4t@git.kernel.org
[ Fixup recent changes in 'perf script --per-event-dump' ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
此提交包含在:
Jiri Olsa
2017-01-23 22:25:41 +01:00
提交者 Arnaldo Carvalho de Melo
父節點 8ceb41d7e3
當前提交 eae8ad8042
共有 23 個檔案被更改,包括 127 行新增97 行删除

查看文件

@@ -30,8 +30,10 @@ static int session_write_header(char *path)
{
struct perf_session *session;
struct perf_data data = {
.path = path,
.mode = PERF_DATA_MODE_WRITE,
.file = {
.path = path,
},
.mode = PERF_DATA_MODE_WRITE,
};
session = perf_session__new(&data, false, NULL);
@@ -46,7 +48,7 @@ static int session_write_header(char *path)
session->header.data_size += DATA_SIZE;
TEST_ASSERT_VAL("failed to write header",
!perf_session__write_header(session, session->evlist, data.fd, true));
!perf_session__write_header(session, session->evlist, data.file.fd, true));
perf_session__delete(session);
@@ -57,8 +59,10 @@ static int check_cpu_topology(char *path, struct cpu_map *map)
{
struct perf_session *session;
struct perf_data data = {
.path = path,
.mode = PERF_DATA_MODE_READ,
.file = {
.path = path,
},
.mode = PERF_DATA_MODE_READ,
};
int i;