-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
symbolizer: Symbolization implemented in Go #314
Conversation
Signed-off-by: Kemal Akkoyun <[email protected]>
Add demangling support Signed-off-by: Kemal Akkoyun <[email protected]>
Signed-off-by: Kemal Akkoyun <[email protected]>
pkg/symbolizer/symbolizer_test.go
Outdated
@@ -277,7 +285,7 @@ func TestRealSymbolizer(t *testing.T) { | |||
}) | |||
require.Equal(t, 3, len(lines)) | |||
require.Equal(t, "/home/brancz/src/github.com/polarsignals/pprof-labels-example/main.go", lines[0].Function.Filename) | |||
require.Equal(t, int64(10), lines[0].Line) | |||
require.Equal(t, int64(7), lines[0].Line) // llvm-addr2line gives 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brancz My only concern is this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as long as inlining works in general I'm ok with anything that works consistently and we can improve in the future
Signed-off-by: Kemal Akkoyun <[email protected]>
Signed-off-by: Kemal Akkoyun <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really amazing work! 💯
Nothing that stands out, just a few questions on clarification and making sure we follow up on documentation.
@@ -62,6 +63,8 @@ type Flags struct { | |||
|
|||
StorageTSDBRetentionTime time.Duration `default:"6h" help:"How long to retain samples in storage."` | |||
StorageTSDBExpensiveMetrics bool `default:"false" help:"Enable really heavy metrics. Only do this for debugging as the metrics are slowing Parca down by a lot." hidden:"true"` | |||
|
|||
SymbolizerDemangleMode string `default:"simple" help:"Mode to demangle C++ symbols. Default mode is simplified: : no parameters, no templates, no return type" enum:"simple,full,none,templates"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do I as a user know what to choose here? Maybe we can at least open an issue on the docs repo to clarify what this is, what it means and how to configure it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) | ||
|
||
func DWARF(demangler *demangle.Demangler, _ *profile.Mapping, path string) (func(addr uint64) ([]profile.Line, error), error) { | ||
// TODO(kakkoyun): Handle offset, start and limit? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we open an issue for this? I think we will need this to symbolize dynamically linked libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Kemal Akkoyun <[email protected]>
@@ -59,6 +59,8 @@ func (s *Symbolizer) NewLiner(m *profile.Mapping, file string) (liner, error) { | |||
} | |||
if hasDWARF { | |||
level.Debug(s.logger).Log("msg", "using DWARF to resolve symbols", "file", file) | |||
// TODO(kakkoyun): Add cache per file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -84,6 +84,7 @@ func (s *Symbolizer) symbolize(ctx context.Context, locations []*profile.Locatio | |||
var result *multierror.Error | |||
for id, mapping := range mappings { | |||
level.Debug(s.logger).Log("msg", "storage symbolization request started", "buildid", mapping.BuildID) | |||
// TODO(kakkoyun): Cache failed symbolization attempts per location. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing!
Fixes #276, #213
There's a lot of room for improvement (which will be addressed in subsequent PRs)