tracing: Update some tracing_map constants and comments
authorTom Zanussi <tom.zanussi@linux.intel.com>
Thu, 3 Mar 2016 18:54:41 +0000 (12:54 -0600)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 19 Apr 2016 16:16:06 +0000 (12:16 -0400)
Make it clear exactly how many keys and values are supported through
better defines, and add 1 to the vals count, since normally clients
want support for at least a hitcount and two other values.

Also, note the error return value for tracing_map_add_key/val_field()
in the comments.

Link: http://lkml.kernel.org/r/6696fa02ebc716aa344c27a571a2afaa25e5b4d4.1457029949.git.tom.zanussi@linux.intel.com
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/tracing_map.c
kernel/trace/tracing_map.h

index dd6401dd145ed224eed16db33a563935816ef40d..e0f172932eca645859b8ee2e81b84564f3c8bd9c 100644 (file)
@@ -163,7 +163,7 @@ static int tracing_map_add_field(struct tracing_map *map,
  * tracing_map_update_sum() or reading it via tracing_map_read_sum().
  *
  * Return: The index identifying the field in the map and associated
- * tracing_map_elts.
+ * tracing_map_elts, or -EINVAL on error.
  */
 int tracing_map_add_sum_field(struct tracing_map *map)
 {
@@ -184,7 +184,7 @@ int tracing_map_add_sum_field(struct tracing_map *map)
  * the key referenced by this key field resides.
  *
  * Return: The index identifying the field in the map and associated
- * tracing_map_elts.
+ * tracing_map_elts, or -EINVAL on error.
  */
 int tracing_map_add_key_field(struct tracing_map *map,
                              unsigned int offset,
index 1f7eda5487873a94d7ad8a781ba48b349f6a7dc5..618838f5f30acaa3c4ab78c7b19329128e1b56b7 100644 (file)
@@ -5,9 +5,10 @@
 #define TRACING_MAP_BITS_MAX           17
 #define TRACING_MAP_BITS_MIN           7
 
-#define TRACING_MAP_FIELDS_MAX         4
 #define TRACING_MAP_KEYS_MAX           2
-
+#define TRACING_MAP_VALS_MAX           3
+#define TRACING_MAP_FIELDS_MAX         (TRACING_MAP_KEYS_MAX + \
+                                        TRACING_MAP_VALS_MAX)
 #define TRACING_MAP_SORT_KEYS_MAX      2
 
 typedef int (*tracing_map_cmp_fn_t) (void *val_a, void *val_b);