提交 83b2ea25 编写于 作者: A Adrian Hunter 提交者: Arnaldo Carvalho de Melo

perf tools: Allow auxtrace data alignment

Allow auxtrace data to be a multiple of something other than page size.
That is needed for BTS where the buffer contains 24-byte records.
Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1432906425-9911-11-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 38e89d2b
......@@ -1182,6 +1182,13 @@ static int __auxtrace_mmap__read(struct auxtrace_mmap *mm,
data2 = NULL;
}
if (itr->alignment) {
unsigned int unwanted = len1 % itr->alignment;
len1 -= unwanted;
size -= unwanted;
}
/* padding must be written by fn() e.g. record__process_auxtrace() */
padding = size & 7;
if (padding)
......
......@@ -303,6 +303,7 @@ struct auxtrace_record {
const char *str);
u64 (*reference)(struct auxtrace_record *itr);
int (*read_finish)(struct auxtrace_record *itr, int idx);
unsigned int alignment;
};
#ifdef HAVE_AUXTRACE_SUPPORT
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册