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

realtime: Include PID/TID in some error messages #1655

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrew-sayers
Copy link
Contributor

The PID is useful when debugging issues related to these messages, so we can check whether the PID has some strange property that caused the problem.

In my case, this made it easier to debug #1653 - the PID showed it was caused by Firefox, so I knew to look there.

src/realtime.c Outdated
g_warning ("Realtime error: %s", (*error)->message);
return FALSE;
}

if (pidns_id != 0 && !xdp_map_tids (pidns_id, *pid, tid, 1, error))
{
g_prefix_error (error, "Could not map tid: ");
g_prefix_error (error, "Could not map tid %d of pid %d: ", *tid, *pid);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will log the mapped pid, the other will log the unmapped pid. That might be confusing if not explicit, e.g. "of mapped pid %d" or "of pid %d mapped to %d" or something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - updated to "mapped pid". The original pid would need to be stored separately if we wanted to print it here - seems like overkill unless a use case pops up for this particular message.

The PID is useful when debugging issues related to these messages,
so we can check whether the PID has some strange property
that caused the problem.
@swick
Copy link
Collaborator

swick commented Feb 28, 2025

LGTM

@andrew-sayers
Copy link
Contributor Author

LGTM

For the record, I was adding the comment at the top of the patch at the same time @swick was typing this, based on feedback in the now-resolved discussion. The PR is otherwise identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants