linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3] cgroup: Trace event cgroup id fields should be u64
@ 2021-12-01 16:56 William Kucharski
  2021-12-01 17:16 ` Steven Rostedt
  2021-12-01 17:24 ` Tejun Heo
  0 siblings, 2 replies; 3+ messages in thread
From: William Kucharski @ 2021-12-01 16:56 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar, Tejun Heo, Greg Kroah-Hartman, LKML
  Cc: william.kucharski

Various trace event fields that store cgroup IDs were declared as
ints, but cgroup_id(() returns a u64 and the structures and associated
TP_printk() calls were not updated to reflect this.

Fixes: 743210386c03 ("cgroup: use cgrp->kn->id as the cgroup ID")
Signed-off-by: William Kucharski <william.kucharski@oracle.com>
---
 V3: Reorder structures to avoid leaving alignment padding holes
 V2: Do not remove tabs from macro definitions

 include/trace/events/cgroup.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/trace/events/cgroup.h b/include/trace/events/cgroup.h
index 7f42a3de59e6..dd7d7c9efecd 100644
--- a/include/trace/events/cgroup.h
+++ b/include/trace/events/cgroup.h
@@ -59,8 +59,8 @@ DECLARE_EVENT_CLASS(cgroup,
 
 	TP_STRUCT__entry(
 		__field(	int,		root			)
-		__field(	int,		id			)
 		__field(	int,		level			)
+		__field(	u64,		id			)
 		__string(	path,		path			)
 	),
 
@@ -71,7 +71,7 @@ DECLARE_EVENT_CLASS(cgroup,
 		__assign_str(path, path);
 	),
 
-	TP_printk("root=%d id=%d level=%d path=%s",
+	TP_printk("root=%d id=%llu level=%d path=%s",
 		  __entry->root, __entry->id, __entry->level, __get_str(path))
 );
 
@@ -126,8 +126,8 @@ DECLARE_EVENT_CLASS(cgroup_migrate,
 
 	TP_STRUCT__entry(
 		__field(	int,		dst_root		)
-		__field(	int,		dst_id			)
 		__field(	int,		dst_level		)
+		__field(	u64,		dst_id			)
 		__field(	int,		pid			)
 		__string(	dst_path,	path			)
 		__string(	comm,		task->comm		)
@@ -142,7 +142,7 @@ DECLARE_EVENT_CLASS(cgroup_migrate,
 		__assign_str(comm, task->comm);
 	),
 
-	TP_printk("dst_root=%d dst_id=%d dst_level=%d dst_path=%s pid=%d comm=%s",
+	TP_printk("dst_root=%d dst_id=%llu dst_level=%d dst_path=%s pid=%d comm=%s",
 		  __entry->dst_root, __entry->dst_id, __entry->dst_level,
 		  __get_str(dst_path), __entry->pid, __get_str(comm))
 );
@@ -171,8 +171,8 @@ DECLARE_EVENT_CLASS(cgroup_event,
 
 	TP_STRUCT__entry(
 		__field(	int,		root			)
-		__field(	int,		id			)
 		__field(	int,		level			)
+		__field(	u64,		id			)
 		__string(	path,		path			)
 		__field(	int,		val			)
 	),
@@ -185,7 +185,7 @@ DECLARE_EVENT_CLASS(cgroup_event,
 		__entry->val = val;
 	),
 
-	TP_printk("root=%d id=%d level=%d path=%s val=%d",
+	TP_printk("root=%d id=%llu level=%d path=%s val=%d",
 		  __entry->root, __entry->id, __entry->level, __get_str(path),
 		  __entry->val)
 );
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V3] cgroup: Trace event cgroup id fields should be u64
  2021-12-01 16:56 [PATCH V3] cgroup: Trace event cgroup id fields should be u64 William Kucharski
@ 2021-12-01 17:16 ` Steven Rostedt
  2021-12-01 17:24 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2021-12-01 17:16 UTC (permalink / raw)
  To: William Kucharski; +Cc: Ingo Molnar, Tejun Heo, Greg Kroah-Hartman, LKML

On Wed,  1 Dec 2021 09:56:58 -0700
William Kucharski <william.kucharski@oracle.com> wrote:

> Various trace event fields that store cgroup IDs were declared as
> ints, but cgroup_id(() returns a u64 and the structures and associated
> TP_printk() calls were not updated to reflect this.
> 
> Fixes: 743210386c03 ("cgroup: use cgrp->kn->id as the cgroup ID")
> Signed-off-by: William Kucharski <william.kucharski@oracle.com>
> ---
>  V3: Reorder structures to avoid leaving alignment padding holes
>  V2: Do not remove tabs from macro definitions
> 
>  include/trace/events/cgroup.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

From a tracing POV:

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V3] cgroup: Trace event cgroup id fields should be u64
  2021-12-01 16:56 [PATCH V3] cgroup: Trace event cgroup id fields should be u64 William Kucharski
  2021-12-01 17:16 ` Steven Rostedt
@ 2021-12-01 17:24 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2021-12-01 17:24 UTC (permalink / raw)
  To: William Kucharski; +Cc: Steven Rostedt, Ingo Molnar, Greg Kroah-Hartman, LKML

On Wed, Dec 01, 2021 at 09:56:58AM -0700, William Kucharski wrote:
> Various trace event fields that store cgroup IDs were declared as
> ints, but cgroup_id(() returns a u64 and the structures and associated
> TP_printk() calls were not updated to reflect this.
> 
> Fixes: 743210386c03 ("cgroup: use cgrp->kn->id as the cgroup ID")
> Signed-off-by: William Kucharski <william.kucharski@oracle.com>

Applied to cgroup/for-5.17.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-01 17:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 16:56 [PATCH V3] cgroup: Trace event cgroup id fields should be u64 William Kucharski
2021-12-01 17:16 ` Steven Rostedt
2021-12-01 17:24 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).