My point about weak function was actually for the arch specific header string. But I guess we should not force it to data->ins_latBecause in other archs, the var2_w of ‘perf_sample_weight’ could be used to capture something else than the Local INSTR Latency.I agree that the var2_w has different meanings among architectures. We should not force it to data->ins_lat.
Can we have some weak function to populate the header string ?
The patch as below should fix it. Does it work for you?
as you mentioned. I checked the below patch defining an ‘arch_perf_parse_sample_weight' for powerpc and it works.
But one observation is that, for cases with kernel having support for PERF_SAMPLE_WEIGHT_STRUCT but missing arch specific support for ‘arch_perf_parse_sample_weight', it will report ‘Local Weight’ wrongly since weak function takes it as 64 bit. Not sure if that is a valid case to consider though.