This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profgen] Fix a bug of assertion
ClosedPublic

Authored by wlei on Sep 22 2021, 10:14 AM.

Details

Summary

The assertion should work on the entire context.

Diff Detail

Event Timeline

wlei created this revision.Sep 22 2021, 10:14 AM
wlei requested review of this revision.Sep 22 2021, 10:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2021, 10:14 AM
wlei edited the summary of this revision. (Show Details)Sep 22 2021, 10:15 AM
wlei added reviewers: hoy, wenlei.
hoy added a comment.Sep 22 2021, 10:27 AM

Good catch. What is the case you saw that the call stack has only one leaf frame? Is it in the main function?

wenlei accepted this revision.Sep 22 2021, 11:37 AM

Thanks! I have the same question as hongtao, but the change lgtm.

This revision is now accepted and ready to land.Sep 22 2021, 11:37 AM
wlei added a comment.Sep 22 2021, 1:14 PM

Good catch. What is the case you saw that the call stack has only one leaf frame? Is it in the main function?

Good question. main should be one case if it hit any samples. In my run, it showed like below. seems it's from external lib.

jemalloc_je_edata_heap_insert
jemalloc_je_arena_dalloc_bin_locked_handle_newly_nonempty
jemalloc_je_edata_heap_remove_first
jemalloc_je_arena_cache_bin_fill_small
extent_record
_ZdlPvm

Not sure why this doesn't have context.

Good catch. What is the case you saw that the call stack has only one leaf frame? Is it in the main function?

Good question. main should be one case if it hit any samples. In my run, it showed like below. seems it's from external lib.

jemalloc_je_edata_heap_insert
jemalloc_je_arena_dalloc_bin_locked_handle_newly_nonempty
jemalloc_je_edata_heap_remove_first
jemalloc_je_arena_cache_bin_fill_small
extent_record
_ZdlPvm

Not sure why this doesn't have context.

perhaps external code called these allocator functions. we're not going to optimize these anyways.

hoy accepted this revision.Sep 22 2021, 1:18 PM

Good catch. What is the case you saw that the call stack has only one leaf frame? Is it in the main function?

Good question. main should be one case if it hit any samples. In my run, it showed like below. seems it's from external lib.

jemalloc_je_edata_heap_insert
jemalloc_je_arena_dalloc_bin_locked_handle_newly_nonempty
jemalloc_je_edata_heap_remove_first
jemalloc_je_arena_cache_bin_fill_small
extent_record
_ZdlPvm

Not sure why this doesn't have context.

I see, it's not user code. Probably because jemalloc isn't built with fp omission off.

wlei added a comment.Sep 22 2021, 1:23 PM

perhaps external code called these allocator functions. we're not going to optimize these anyways.

I see, it's not user code. Probably because jemalloc isn't built with fp omission off.

I see, thanks for the context.

This revision was landed with ongoing or failed builds.Sep 22 2021, 6:34 PM
This revision was automatically updated to reflect the committed changes.