From patchwork Wed Jul 13 21:03:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102021 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1198251qga; Wed, 13 Jul 2016 14:05:09 -0700 (PDT) X-Received: by 10.98.54.198 with SMTP id d189mr6834595pfa.39.1468443909036; Wed, 13 Jul 2016 14:05:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v76si101805pfa.20.2016.07.13.14.05.08; Wed, 13 Jul 2016 14:05:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751518AbcGMVEv (ORCPT + 4 others); Wed, 13 Jul 2016 17:04:51 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:51079 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbcGMVEt (ORCPT ); Wed, 13 Jul 2016 17:04:49 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0MB1l6-1bV6Iq2KzU-009zAi; Wed, 13 Jul 2016 23:04:04 +0200 From: Arnd Bergmann To: Jiri Pirko Cc: netdev@vger.kernel.org, Steven Rostedt , Ingo Molnar , "David S . Miller" , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH net-next 1/2] devlink: fix build error for CONFIG_MODULES=n Date: Wed, 13 Jul 2016 23:03:37 +0200 Message-Id: <20160713210338.1647521-1-arnd@arndb.de> X-Mailer: git-send-email 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-Mailing-List: netdev@vger.kernel.org A driver calling trace_devlink_hwmsg cannot be built when modules are disabled: include/trace/events/devlink.h: In function 'trace_event_get_offsets_devlink_hwmsg': include/trace/events/devlink.h:25:51: error: dereferencing pointer to incomplete type 'struct module' __string(owner_name, devlink->dev->driver->owner->name) This changes the code to only print the module name when modules are actually enabled, otherwise we hardcode the string "built-in". Signed-off-by: Arnd Bergmann Fixes: e5224f0fe2ac ("devlink: add hardware messages tracing facility") --- include/trace/events/devlink.h | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.9.0 diff --git a/include/trace/events/devlink.h b/include/trace/events/devlink.h index 333c32ac9bfa..26f92d3c7e9c 100644 --- a/include/trace/events/devlink.h +++ b/include/trace/events/devlink.h @@ -22,7 +22,11 @@ TRACE_EVENT(devlink_hwmsg, TP_STRUCT__entry( __string(bus_name, devlink->dev->bus->name) __string(dev_name, dev_name(devlink->dev)) +#ifdef CONFIG_MODULES __string(owner_name, devlink->dev->driver->owner->name) +#else + __string(owner_name, "built-in") +#endif __field(bool, incoming) __field(unsigned long, type) __dynamic_array(u8, buf, len) @@ -32,7 +36,11 @@ TRACE_EVENT(devlink_hwmsg, TP_fast_assign( __assign_str(bus_name, devlink->dev->bus->name); __assign_str(dev_name, dev_name(devlink->dev)); +#ifdef CONFIG_MODULES __assign_str(owner_name, devlink->dev->driver->owner->name); +#else + __assign_str(owner_name, "built-in"); +#endif __entry->incoming = incoming; __entry->type = type; memcpy(__get_dynamic_array(buf), buf, len); From patchwork Wed Jul 13 21:03:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102022 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1197960qga; Wed, 13 Jul 2016 14:04:30 -0700 (PDT) X-Received: by 10.66.160.41 with SMTP id xh9mr17235531pab.85.1468443869968; Wed, 13 Jul 2016 14:04:29 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si2268319pax.288.2016.07.13.14.04.29; Wed, 13 Jul 2016 14:04:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751426AbcGMVEW (ORCPT + 4 others); Wed, 13 Jul 2016 17:04:22 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:55157 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbcGMVET (ORCPT ); Wed, 13 Jul 2016 17:04:19 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0LzYuY-1bIPDC3KqY-014gra; Wed, 13 Jul 2016 23:04:04 +0200 From: Arnd Bergmann To: Jiri Pirko Cc: netdev@vger.kernel.org, Steven Rostedt , Ingo Molnar , "David S . Miller" , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH net-next 2/2] devlink: fix trace format string Date: Wed, 13 Jul 2016 23:03:38 +0200 Message-Id: <20160713210338.1647521-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160713210338.1647521-1-arnd@arndb.de> References: <20160713210338.1647521-1-arnd@arndb.de> X-Provags-ID: V03:K0:p/o3s9USe7SBu+KUIOeLJZGXb6MK6hJayuKeIrfym4uqY1N5II7 Z8iFEOmgAzJgPv7aCmR75Z76sAYF9WS8UeyjUP8n2hJZ6CpRjGMtVXwpaCuDJnk0h6jnhcW /8k8fP9Fd0NHl9zEjNUqNpAMrfm/Bn/MIvPnA7KtuWYibpiAl4QMdPYr+ACukgpirp5rYGO WgVSfRNeu7kQww5dmAxHA== X-UI-Out-Filterresults: notjunk:1; V01:K0:1fIr+0JerYg=:47IqlTsntzrKE6w2fqQk36 pPUEn96dPaSVmHzBErflwWjNFnjhShHGp4uPAYIiYiDwwipRpmcprcKTnr73bexmv4yCoV89z 1r6tq4I/C7qXFyG8GiiEOmUS8MU5qsbeXoW8l3FM4JEIycnWJzaZNVnOY7q2eEQYXiw0l7m+U idwc5m/qIUFhhq7aGGxmB9GcpGGf0vTRCl63KR2yEe0ejVgTvfIfLKpLd8NyYnA/x7RJ4RAGL M3hRM2DSV5riD3CB9USrUb3NZ/A3qegrWt5uuBsY7Y8LXwM/cq0AYeZcz/XmU5tmlEiFikxQI z9bQDTk+Y6SfhPy4JGUJW2/IwGrxf7NuCWoRQJJC8rxPj6H2YDccSwyEq8ZNlYcvvrNPUpwYn JCpwDuePaZ6arYPE09ZEHYFy+d5kaCRrzy71zWYuV1vaZ4xqLMxd/6rqYWIdRAv1VSPvq6SKX pnn/jzlSMVd+77bcF+DsOb4WcC7HOrSgXo9YPwWTN1uFba/8QKgUAZHsYb5lOQElAPNUhNy1h aZQr++E+j2LZOsfpV/Bx50tWyR+Vz34y/xuJfVZkrdRLKq7ExCACgTHi/vQa5NkJq/9Bq6oJM CcD48GyOiV34hVtuFMilGCTTpf5egvdgXLy/gnlmSF9IUb4tXpHPm3baTNGA5aB2xnqLEgUKT 7RLojOJFwqPF1hKrgNG565eX9CzRiAmCE+RNWzDTqvllG7xGMSsFeRPM94obwcj01lpw= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Including devlink.h on ARM and probably other 32-bit architectures results in a harmless warning: In file included from ../include/trace/define_trace.h:95:0, from ../include/trace/events/devlink.h:51, from ../net/core/devlink.c:30: include/trace/events/devlink.h: In function 'trace_raw_output_devlink_hwmsg': include/trace/events/devlink.h:42:12: error: format '%lu' expects argument of type 'long unsigned int', but argument 10 has type 'size_t {aka unsigned int}' [-Werror=format=] The correct format string for 'size_t' is %zu, not %lu, this works on all architectures. Signed-off-by: Arnd Bergmann Fixes: e5224f0fe2ac ("devlink: add hardware messages tracing facility") --- include/trace/events/devlink.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/include/trace/events/devlink.h b/include/trace/events/devlink.h index 26f92d3c7e9c..4b75a6f986fc 100644 --- a/include/trace/events/devlink.h +++ b/include/trace/events/devlink.h @@ -47,7 +47,7 @@ TRACE_EVENT(devlink_hwmsg, __entry->len = len; ), - TP_printk("bus_name=%s dev_name=%s owner_name=%s incoming=%d type=%lu buf=0x[%*phD] len=%lu", + TP_printk("bus_name=%s dev_name=%s owner_name=%s incoming=%d type=%lu buf=0x[%*phD] len=%zu", __get_str(bus_name), __get_str(dev_name), __get_str(owner_name), __entry->incoming, __entry->type, (int) __entry->len, __get_dynamic_array(buf), __entry->len)