Skip to content

Commit c29d979

Browse files
ahunter6acmel
authored andcommitted
perf inject: Fix itrace space allowed for new attributes
The space allowed for new attributes can be too small if existing header information is large. That can happen, for example, if there are very many CPUs, due to having an event ID per CPU per event being stored in the header information. Fix by adding the existing header.data_offset. Also increase the extra space allowed to 8KiB and align to a 4KiB boundary for neatness. Signed-off-by: Adrian Hunter <[email protected]> Cc: Jiri Olsa <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 71a16df commit c29d979

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/builtin-inject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ static int __cmd_inject(struct perf_inject *inject)
820820
inject->tool.ordered_events = true;
821821
inject->tool.ordering_requires_timestamps = true;
822822
/* Allow space in the header for new attributes */
823-
output_data_offset = 4096;
823+
output_data_offset = roundup(8192 + session->header.data_offset, 4096);
824824
if (inject->strip)
825825
strip_init(inject);
826826
}

0 commit comments

Comments
 (0)