Thread (40 messages) 40 messages, 6 authors, 2021-12-13

Re: [PATCH 01/22] libperf: Add comments to perf_cpu_map.

From: John Garry <hidden>
Date: 2021-12-08 12:06:14
Also in: linux-perf-users, lkml

On 08/12/2021 02:45, Ian Rogers wrote:
quoted hunk ↗ jump to hunk
diff --git a/tools/lib/perf/include/internal/cpumap.h b/tools/lib/perf/include/internal/cpumap.h
index 840d4032587b..1c1726f4a04e 100644
--- a/tools/lib/perf/include/internal/cpumap.h
+++ b/tools/lib/perf/include/internal/cpumap.h
@@ -4,9 +4,16 @@
  
  #include <linux/refcount.h>
  
+/**
+ * A sized, reference counted, sorted array of integers representing CPU
+ * numbers. This is commonly used to capture which CPUs a PMU is associated
+ * with.
+ */
  struct perf_cpu_map {
  	refcount_t	refcnt;
+	/** Length of the map array. */
  	int		nr;
+	/** The CPU values. */
  	int		map[];
would simply more distinct names for the variables help instead of or in 
addition to comments?

Generally developers don't always check comments where the struct is 
defined when the meaning could be judged intuitively

Thanks,
John


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help