honggyukim / heaptrace

a tool that collects and reports heap allocated memory
GNU General Public License v2.0
13 stars 3 forks source link

Add alarm filtering (suppressions) feature #23

Open Bojun-Seo opened 1 year ago

Bojun-Seo commented 1 year ago

Sometimes user wants to remove some reports which are not necessary to be trace. So I suggest to add alarm filtering feature. Like suppressions feature on llvm-project Sanitizers https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer#suppressions

honggyukim commented 1 year ago

We can support it but it might take a while if I have to do. Would you like to try that?

Bojun-Seo commented 1 year ago

OK great, I will make a patch soon.

Bojun-Seo commented 1 year ago

I'm currently implementing this feature. Followings are the draft patch. https://github.com/Bojun-Seo/heaptrace/commit/cdd04b6d5ce275d71af4fe28eee47ff74c112551 And I have two issues on this patch.

  1. I copied TemplateMatch function from llvm-project, so I need to check license issue.
  2. Duplicated symbol resolving issue is_suppressed flag sets on record_backtrace function(this patch, resembles llvm-project). Symbol resolving is needed to do this on here. But symbol will be resolved on printing phase later. So duplicated symbol resolving will be happened with this patch. It could be possible to eliminate this duplication by caching symbols, Or just check suppressions on printing phase with already resolved symbols.
Bojun-Seo commented 1 year ago

I implement this feature. https://github.com/honggyukim/heaptrace/pull/28