On Wed, 20 Nov 2013 19:01:22 -0700
Shuah Khan <shuah.kh@xxxxxxxxxxx> wrote:
On 11/20/2013 06:40 PM, Shuah Khan wrote:
---
include/trace/events/power.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index cda100d..5ba545a 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -110,12 +110,14 @@ DECLARE_EVENT_CLASS(wakeup_source,
TP_ARGS(name, state),
TP_STRUCT__entry(
- __string( name, name )
+ __string(name, name ? name : "(no name)")
__field( u64, state )
),
TP_fast_assign(
- __assign_str(name, name);
+ const char *tname = name ? name : "(no name)";
+
+ __assign_str(name, tname);
__entry->state = state;
),
Adding tracing maintainers.
Thanks!
This is one solution, but what about just making the tracing facility a
bit more robust for everyone. Following what glibc printf() does when
it is passed a NULL, does this patch fix it too?