Skip to content

Commit

Permalink
[process][darwin]: fix incorrect logging (#161)
Browse files Browse the repository at this point in the history
## What does this PR do?

The order of arguments in the logger is incorrect. `pid` should be
logged first and then the size returned.

## Checklist

<!-- Mandatory
Add a checklist of things that are required to be reviewed in order to
have the PR approved

List here all the items you have verified BEFORE sending this PR. Please
DO NOT remove any item, striking through those that do not apply. (Just
in case, strikethrough uses two tildes. ~~Scratch this.~~)
-->

- [x] My code follows the style guidelines of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added an entry in `CHANGELOG.md`
  • Loading branch information
VihasMakwana committed Jun 28, 2024
1 parent 1d788ad commit 4ad5322
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metric/system/process/process_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func GetInfoForPid(_ resolve.Resolver, pid int) (ProcState, error) {
// https://opensource.apple.com/source/xnu/xnu-1504.3.12/bsd/sys/proc_info.h.auto.html
n := C.proc_pidinfo(C.int(pid), C.PROC_PIDTASKALLINFO, 0, ptr, size)
if n != size {
return ProcState{}, fmt.Errorf("could not read process info for pid %d: proc_pidinfo returned %d", int(n), pid)
return ProcState{}, fmt.Errorf("could not read process info for pid %d: proc_pidinfo returned %d", pid, int(n))
}

status := ProcState{}
Expand Down

0 comments on commit 4ad5322

Please sign in to comment.