Skip to content

perf annotate-data: Support flexible array types

Namhyung Kim linux-perf-users lkml sashiko-reviews 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 4 repliesIn review
  2. v43 patches 0 repliesSuperseded
  3. v33 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v24 patches13 repliesSuperseded
v14 patches4 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4perf dwarf-aux: Add die_has_flex_array() helpertools/perf/util/dwarf-aux.c tools/perf/util/dwarf-aux.h+110 -00 replies
2/4perf annotate-data: A small cleanup in __add_member_cb()tools/perf/util/annotate-data.c+9 -80 replies
3/4perf annotate-data: Allow out-of-size access for flex-array typestools/perf/util/annotate-data.c tools/perf/util/annotate-data.h+36 -290 replies
4/4perf annotate-data: Adjust type offset for flex-arraytools/perf/util/annotate-data.c tools/perf/util/annotate-data.h+107 -91 reply

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchMasami Hiramatsu (Google)
1/4A-b
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/4] perf annotate-data: Support flexible array types

Hello,

The flexible arrays are dynamically allocated with different size. So checking with the original type size won't match and cannot find the type if the offset is bigger than the size. This patch series detects those flex-arrays and allows accesses beyong the original size.

I'm not sure what's the best way to add test codes for data type profiling as it seems we need to add a lot more workloads for different cases. Probably we may want to split the workloads as separate binaries.

v5 changes)

* add a cleanup patch
* add is_union and is_flex_array fields to find member correctly

v4: https://lore.kernel.org/r/[email protected]/

* update last member even if the offset is same
* handle type qualifiers in die_has_flex_array()
* add zero-length array members as flexible arrays
* check return value of strbuf_init() for type name

v3: https://lore.kernel.org/r/[email protected]

* patch 1 was merged!
* check if last member is found
* check member location when finding flex-array
* ensure member typename is initiailized
* fix a bug to pass a wrong type in check_variable()
* fix a typo in a comment

v2: https://lore.kernel.org/r/[email protected]

* fix missing index increment in the histogram
* support flex array in union types
* add recursion check in die_has_flex_array()
* check negative index arrays properly
* avoid divide-by-zero when the size is unknown

v1: https://lore.kernel.org/r/[email protected]

Thanks,
Namhyung

Cc Zecheng Li <[email protected]>
Cc Yanbo Zhao <[email protected]>
Cc Tengda Wu <[email protected]>
Cc Shuai Xue <[email protected]>

Namhyung Kim (4):
perf dwarf-aux: Add die_has_flex_array() helper
perf annotate-data: A small cleanup in __add_member_cb() perf annotate-data: Allow out-of-size access for flex-array types perf annotate-data: Adjust type offset for flex-array

 tools/perf/util/annotate-data.c | 192 ++++++++++++++++++++++++--------
 tools/perf/util/annotate-data.h |   6 +
 tools/perf/util/dwarf-aux.c     | 107 ++++++++++++++++++
 tools/perf/util/dwarf-aux.h     |   3 +
 4 files changed, 262 insertions(+), 46 deletions(-)
Signature · 1 line
2.55.0