在 2023/12/13 22:44, Steven Rostedt 写道:
+TRACE_EVENT(mm_shrink_count_end,
+ TP_PROTO(struct shrinker *shr, struct shrink_control *sc, long freeable),
+
+ TP_ARGS(shr, sc, freeable),
+
+ TP_STRUCT__entry(
+ __field(struct shrinker *, shr)
+ __field(void *, shrink)
+ __field(int, nid)
int : 4 bytes
+ __field(long, freeable)
long: 8 bytes
You may want to swap the above, otherwise you added a hole in the trace
event. The compiler will add 4 bytes of padding between 'nid' and
'freeable'. That is, if you change it to:
TP_STRUCT__entry(
__field(struct shrinker *, shr)
__field(void *, shrink)
__field(long, freeable)
__field(int, nid)
You will save 4 bytes per event in the ring buffer.
Thanks for your advice, I will fix it.
Thanks,
Bixuan Cui