Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1342311 > unrolled thread

[PATCH v14 01/22] tracing: Update some tracing_map constants and comments

Started byTom Zanussi <tom.zanussi@linux.intel.com>
First post2016-02-24 19:40 +0100
Last post2016-02-25 16:00 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v14 01/22] tracing: Update some tracing_map constants and comments Tom Zanussi <tom.zanussi@linux.intel.com> - 2016-02-24 19:40 +0100
    RE: [PATCH v14 01/22] tracing: Update some tracing_map constants  and comments 平松雅巳 / HIRAMATU,MASAMI   <masami.hiramatsu.pt@hitachi.com> - 2016-02-25 07:00 +0100
      Re: [PATCH v14 01/22] tracing: Update some tracing_map constants  and comments Tom Zanussi <tom.zanussi@linux.intel.com> - 2016-02-25 16:00 +0100

#1342311 — [PATCH v14 01/22] tracing: Update some tracing_map constants and comments

FromTom Zanussi <tom.zanussi@linux.intel.com>
Date2016-02-24 19:40 +0100
Subject[PATCH v14 01/22] tracing: Update some tracing_map constants and comments
Message-ID<r5MvU-4Y-33@gated-at.bofh.it>
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.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 kernel/trace/tracing_map.c | 4 ++--
 kernel/trace/tracing_map.h | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c
index dd6401d..e0f1729 100644
--- a/kernel/trace/tracing_map.c
+++ b/kernel/trace/tracing_map.c
@@ -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,
diff --git a/kernel/trace/tracing_map.h b/kernel/trace/tracing_map.h
index 7571825..b575d0b 100644
--- a/kernel/trace/tracing_map.h
+++ b/kernel/trace/tracing_map.h
@@ -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);
-- 
1.9.3

[toc] | [next] | [standalone]


#1342839 — RE: [PATCH v14 01/22] tracing: Update some tracing_map constants and comments

From平松雅巳 / HIRAMATU,MASAMI <masami.hiramatsu.pt@hitachi.com>
Date2016-02-25 07:00 +0100
SubjectRE: [PATCH v14 01/22] tracing: Update some tracing_map constants and comments
Message-ID<r5X7Z-7HS-27@gated-at.bofh.it>
In reply to#1342311
Hi Tom,

From: Tom Zanussi [mailto:tom.zanussi@linux.intel.com]
>
>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.

OK, but would that (increment the vals count) be possible to apply
later patch? I think we'd better make this a cleanup patch.

Thank you,

>
>Also, note the error return value for tracing_map_add_key/val_field()
>in the comments.
>
>Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
>---
> kernel/trace/tracing_map.c | 4 ++--
> kernel/trace/tracing_map.h | 5 +++--
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
>diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c
>index dd6401d..e0f1729 100644
>--- a/kernel/trace/tracing_map.c
>+++ b/kernel/trace/tracing_map.c
>@@ -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,
>diff --git a/kernel/trace/tracing_map.h b/kernel/trace/tracing_map.h
>index 7571825..b575d0b 100644
>--- a/kernel/trace/tracing_map.h
>+++ b/kernel/trace/tracing_map.h
>@@ -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);
>--
>1.9.3

[toc] | [prev] | [next] | [standalone]


#1343227 — Re: [PATCH v14 01/22] tracing: Update some tracing_map constants and comments

FromTom Zanussi <tom.zanussi@linux.intel.com>
Date2016-02-25 16:00 +0100
SubjectRe: [PATCH v14 01/22] tracing: Update some tracing_map constants and comments
Message-ID<r65yz-5kc-19@gated-at.bofh.it>
In reply to#1342839
Hi Masami,

On Thu, 2016-02-25 at 05:55 +0000, 平松雅巳 / HIRAMATU,MASAMI wrote:
> Hi Tom,
> 
> From: Tom Zanussi [mailto:tom.zanussi@linux.intel.com]
> >
> >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.
> 
> OK, but would that (increment the vals count) be possible to apply
> later patch? I think we'd better make this a cleanup patch.
> 

It's just changing the default VALS_MAX from 2 to 3, and all the
following patches were updated to use the new constants.  I could change
that value to 2 again, and then a later patch to up it to 3, but I don't
see the problem with starting at 3.  Am I missing something? 

Thanks,

Tom

> Thank you,
> 
> >
> >Also, note the error return value for tracing_map_add_key/val_field()
> >in the comments.
> >
> >Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
> >---
> > kernel/trace/tracing_map.c | 4 ++--
> > kernel/trace/tracing_map.h | 5 +++--
> > 2 files changed, 5 insertions(+), 4 deletions(-)
> >
> >diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c
> >index dd6401d..e0f1729 100644
> >--- a/kernel/trace/tracing_map.c
> >+++ b/kernel/trace/tracing_map.c
> >@@ -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,
> >diff --git a/kernel/trace/tracing_map.h b/kernel/trace/tracing_map.h
> >index 7571825..b575d0b 100644
> >--- a/kernel/trace/tracing_map.h
> >+++ b/kernel/trace/tracing_map.h
> >@@ -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);
> >--
> >1.9.3
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web