Skip to content
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

profiler: Fix error handling #2318

Merged
merged 1 commit into from
Nov 29, 2023

Commits on Nov 29, 2023

  1. profiler: Fix error handling

    The err variable was clobbered so we were reading the wrong value
    
    Test Plan
    ========
    
    ```
    --- a/pkg/profiler/cpu/bpf/maps/maps.go
    +++ b/pkg/profiler/cpu/bpf/maps/maps.go
    @@ -1140,6 +1140,7 @@ func (m *Maps) AddUnwindTableForProcess(pid int, executableMappings unwind.Execu
            // is challenging if the process name contains spaces, etc).
            //  - PIDs can be recycled.
    
    +       return fmt.Errorf("le error")
            m.mutex.Lock()
            defer m.mutex.Unlock()
    ```
    
    Before:
    ```
    msg="failed to add unwind table" pid=18846 err=null
    ```
    
    After:
    ```
    msg="failed to add unwind table" pid=18846 err="le err"
    ``
    
    Signed-off-by: Francisco Javier Honduvilla Coto <[email protected]>
    javierhonduco committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    2c1ddd5 View commit details
    Browse the repository at this point in the history