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
Add support for Position Independent Code #252
Conversation
de5584f
to
bfa82f4
Compare
bfa82f4
to
c149982
Compare
} | ||
|
||
func (f *ObjectFile) ObjAddr(addr uint64) (uint64, error) { | ||
f.baseOnce.Do(func() { f.baseErr = f.computeBase(addr) }) |
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.
we already have the NewObjectFile
function that we use to instantiate the struct, let's just do the computation there once
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.
In order to compute the base properly we need an address, that's why we need to defer the calculation until we received an address from the profiler.
@@ -257,6 +318,7 @@ func (p *CgroupProfiler) profileLoop(ctx context.Context, now time.Time, counts, | |||
|
|||
mapping := maps.NewMapping(p.pidMappingFileCache) | |||
kernelMapping := &profile.Mapping{ | |||
// TODO(kakkoyun): Check if this conflicts with https://github.com/google/pprof/pull/675/files |
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.
nice find!
There is a regression, in the branch. I'm trying to find it. Thus, I've marked it as draft again. |
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun kakkoyun@gmail.com
Fixes parca-dev/parca#326
also fixes #256 and #264