From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760839AbcBYOyw (ORCPT ); Thu, 25 Feb 2016 09:54:52 -0500 Received: from mga04.intel.com ([192.55.52.120]:25008 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760740AbcBYOyt (ORCPT ); Thu, 25 Feb 2016 09:54:49 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,498,1449561600"; d="scan'208";a="921021400" Message-ID: <1456412087.11136.9.camel@tzanussi-mobl.amr.corp.intel.com> Subject: Re: [PATCH v14 01/22] tracing: Update some tracing_map constants and comments From: Tom Zanussi To: =?UTF-8?Q?=E5=B9=B3=E6=9D=BE=E9=9B=85=E5=B7=B3?= / =?UTF-8?Q?HIRAMATU=EF=BC=8CMASAMI?= Cc: "rostedt@goodmis.org" , "namhyung@kernel.org" , "josh@joshtriplett.org" , "andi@firstfloor.org" , "mathieu.desnoyers@efficios.com" , "peterz@infradead.org" , "linux-kernel@vger.kernel.org" Date: Thu, 25 Feb 2016 08:54:47 -0600 In-Reply-To: <50399556C9727B4D88A595C8584AAB37B4E196E4@GSjpTKYDCembx32.service.hitachi.net> References: <50399556C9727B4D88A595C8584AAB37B4E196E4@GSjpTKYDCembx32.service.hitachi.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > >--- > > 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 >