Skip to content

Commit 3b772b9

Browse files
tzanussirostedt
authored andcommitted
tracing: Update some tracing_map constants and comments
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>
1 parent 8d44f2f commit 3b772b9

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎kernel/trace/tracing_map.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int tracing_map_add_field(struct tracing_map *map,
163163
* tracing_map_update_sum() or reading it via tracing_map_read_sum().
164164
*
165165
* Return: The index identifying the field in the map and associated
166-
* tracing_map_elts.
166+
* tracing_map_elts, or -EINVAL on error.
167167
*/
168168
int tracing_map_add_sum_field(struct tracing_map *map)
169169
{
@@ -184,7 +184,7 @@ int tracing_map_add_sum_field(struct tracing_map *map)
184184
* the key referenced by this key field resides.
185185
*
186186
* Return: The index identifying the field in the map and associated
187-
* tracing_map_elts.
187+
* tracing_map_elts, or -EINVAL on error.
188188
*/
189189
int tracing_map_add_key_field(struct tracing_map *map,
190190
unsigned int offset,

‎kernel/trace/tracing_map.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
#define TRACING_MAP_BITS_MAX 17
66
#define TRACING_MAP_BITS_MIN 7
77

8-
#define TRACING_MAP_FIELDS_MAX 4
98
#define TRACING_MAP_KEYS_MAX 2
10-
9+
#define TRACING_MAP_VALS_MAX 3
10+
#define TRACING_MAP_FIELDS_MAX (TRACING_MAP_KEYS_MAX + \
11+
TRACING_MAP_VALS_MAX)
1112
#define TRACING_MAP_SORT_KEYS_MAX 2
1213

1314
typedef int (*tracing_map_cmp_fn_t) (void *val_a, void *val_b);

0 commit comments

Comments
 (0)