perf auxtrace: Add auxtrace_record__read_finish()
All ->read_finish() implementations are doing the same thing. Add a helper function so that they can share the same implementation. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Leo Yan <leo.yan@linaro.org> Tested-by: Leo Yan <leo.yan@linaro.org> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Kim Phillips <kim.phillips@arm.com> Cc: Wei Li <liwei391@huawei.com> Link: http://lore.kernel.org/lkml/20200217082300.6301-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

父節點
d6bc34c5ec
當前提交
ad60ba0c2e
@@ -29,6 +29,7 @@ struct record_opts;
|
||||
struct perf_record_auxtrace_error;
|
||||
struct perf_record_auxtrace_info;
|
||||
struct events_stats;
|
||||
struct perf_pmu;
|
||||
|
||||
enum auxtrace_error_type {
|
||||
PERF_AUXTRACE_ERROR_ITRACE = 1,
|
||||
@@ -322,6 +323,8 @@ struct auxtrace_mmap_params {
|
||||
* @read_finish: called after reading from an auxtrace mmap
|
||||
* @alignment: alignment (if any) for AUX area data
|
||||
* @default_aux_sample_size: default sample size for --aux sample option
|
||||
* @pmu: associated pmu
|
||||
* @evlist: selected events list
|
||||
*/
|
||||
struct auxtrace_record {
|
||||
int (*recording_options)(struct auxtrace_record *itr,
|
||||
@@ -346,6 +349,8 @@ struct auxtrace_record {
|
||||
int (*read_finish)(struct auxtrace_record *itr, int idx);
|
||||
unsigned int alignment;
|
||||
unsigned int default_aux_sample_size;
|
||||
struct perf_pmu *pmu;
|
||||
struct evlist *evlist;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -537,6 +542,7 @@ int auxtrace_record__find_snapshot(struct auxtrace_record *itr, int idx,
|
||||
struct auxtrace_mmap *mm,
|
||||
unsigned char *data, u64 *head, u64 *old);
|
||||
u64 auxtrace_record__reference(struct auxtrace_record *itr);
|
||||
int auxtrace_record__read_finish(struct auxtrace_record *itr, int idx);
|
||||
|
||||
int auxtrace_index__auxtrace_event(struct list_head *head, union perf_event *event,
|
||||
off_t file_offset);
|
||||
|
Reference in New Issue
Block a user