On 15/11/2024 11:36, Alan Maguire wrote: > Currently, pahole relies on DWARF to find whether a particular func > has its parameter mismatched with standard or optimized away. > In both these cases, the func will not be put in BTF and this > will prevent fentry/fexit tracing for these functions. > > The current parameter checking focuses on the first location/expression > to match intended parameter register. But in some cases, the first > location/expression does not have expected matching information, > but further location like DW_OP_[GNU_]entry_value can provide > information which matches the expected parameter register. > > Patch 1 supports this; patch 2 adds locking around dwarf_getlocation* > as it is unsafe in a multithreaded environment. > apologies, forgot to note Changes since v2: - handle multiple DW_OP_entry_value expressions by bailing if the register matches expected, otherwise save reg in return value (Eduard Yonghong, Jiri, patch 1) > Alan Maguire (1): > dwarf_loader: use libdw__lock for dwarf_getlocation(s) > > Eduard Zingerman (1): > dwarf_loader: Check DW_OP_[GNU_]entry_value for possible parameter > matching > > dwarf_loader.c | 123 +++++++++++++++++++++++++++++++++++++++---------- > 1 file changed, 98 insertions(+), 25 deletions(-) >