systemtap: Use correct formatters/types

Try to avoid casting variables to potentially smaller types to fit
defined probes. This can truncate values and lead to wrong results.

Also make sure that signedness matches.

Since GType can be even 128 bit on CHERI architecture, cast all these
various types used based on platform to uintmax_t which SystemTap
properly processes.
This commit is contained in:
Tobias Stoeckmann
2025-08-08 22:53:15 +02:00
parent 6812587543
commit b8f9743a4d
9 changed files with 76 additions and 74 deletions

View File

@@ -481,7 +481,7 @@ type_node_any_new_W (TypeNode *pnode,
pnode->children[i] = type;
}
TRACE(GOBJECT_TYPE_NEW(name, node->supers[1], type));
TRACE (GOBJECT_TYPE_NEW (name, node->supers[1], (uintmax_t) type));
node->plugin = plugin;
node->n_children = 0;
@@ -1906,7 +1906,7 @@ g_type_create_instance (GType type)
}
#endif
TRACE(GOBJECT_OBJECT_NEW(instance, type));
TRACE (GOBJECT_OBJECT_NEW (instance, (uintmax_t) type));
return instance;
}