Skip to content

Commit

Permalink
realtime: Include PID/TID in some error messages
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrew-sayers committed Feb 27, 2025
1 parent f7837cc commit ce776d9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/realtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,25 @@ static gboolean
map_pid (XdpAppInfo *app_info, pid_t *pid, pid_t *tid, GError **error)
{
ino_t pidns_id;
const pid_t unmapped_pid = *pid;

if (!xdp_app_info_get_pidns (app_info, &pidns_id, error))
{
g_prefix_error (error, "Could not get pidns: ");
g_prefix_error (error, "Could not get pidns for pid %d: ", unmapped_pid);
g_warning ("Realtime error: %s", (*error)->message);
return FALSE;
}

if (pidns_id != 0 && !xdp_map_pids (pidns_id, pid, 1, error))
{
g_prefix_error (error, "Could not map pid: ");
g_prefix_error (error, "Could not map pid %d: ", unmapped_pid);
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, unmapped_pid);
g_warning ("Realtime error: %s", (*error)->message);
return FALSE;
}
Expand Down

0 comments on commit ce776d9

Please sign in to comment.