Skip to content

Instantly share code, notes, and snippets.

@fcasal
Last active October 31, 2022 14:55
Show Gist options
  • Save fcasal/b8bff3d9fbc548c800bb49627feadd02 to your computer and use it in GitHub Desktop.
Save fcasal/b8bff3d9fbc548c800bb49627feadd02 to your computer and use it in GitHub Desktop.
from StructAllocatedByKmalloc s_kmalloc,
     StructWithFunctionPtr s_fptrs
where s_kmalloc = s_fptrs
select
  s_fptrs.countFieldsOfFunctionPtrs() as amount_of_fptrs,
  s_fptrs,
  s_kmalloc.getAFunctionCall() as call_site,
  count(s_kmalloc.getAFunctionCall()) as kmalloc_times
order by amount_of_fptrs desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment