qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] e1000e: Fix build with ust trace backend
@ 2016-06-02 19:12 Dmitry Fleytman
  2016-06-03 11:03 ` Peter Maydell
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Fleytman @ 2016-06-02 19:12 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jason Wang, Yan Vugenfirer, Leonid Bloch, Shmulik Ladkani,
	Peter Maydell

ust trace backend has limitation of maximum 10
arguments per event. Traces with more arguments
cannot be compiled for this backend.

Trace e1000e_rx_rss_ip6 introduced by previous
commits has 11 arguments and fails to compile with
ust trace backend.

This patch fixes the problem by splitting this
tracepoint into two successive tracepoints with
smaller number of arguments.

For more information see comment regarding TP_ARGS
in lttng/tracepoint.h:

/*
* TP_ARGS takes tuples of type, argument separated by a comma.
* It can take up to 10 tuples (which means that less than 10 tuples is
* fine too).
* Each tuple is also separated by a comma.
*/

Build log generated by this problem:

In file included from ./trace/generated-tracers.h:9:0,
                 from /home/travis/build/qemu/qemu/include/trace.h:4,
                 from util/oslib-posix.c:36:
./trace/generated-ust-provider.h:16556:3: error: unknown type name ‘_TP_EXPROTO_Bool’
In file included from /home/travis/build/qemu/qemu/include/trace.h:4:0,
                 from util/oslib-posix.c:36:
./trace/generated-tracers.h: In function ‘trace_e1000e_rx_rss_ip6’:
./trace/generated-tracers.h:8379:431: error: expected string literal before ‘_SDT_ASM_OPERANDS_ipv6_enabled’
./trace/generated-tracers.h:8379:431: error: implicit declaration of function ‘__tracepoint_cb_qemu___e1000e_rx_rss_ip6’ [-Werror=implicit-function-declaration]
./trace/generated-tracers.h:8379:431: error: nested extern declaration of ‘__tracepoint_cb_qemu___e1000e_rx_rss_ip6’ [-Werror=nested-externs]
cc1: all warnings being treated as errors
make: *** [util/oslib-posix.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ./trace/generated-tracers.h:9:0,
                 from /home/travis/build/qemu/qemu/include/trace.h:4,
                 from util/hbitmap.c:16:
./trace/generated-ust-provider.h:16556:3: error: unknown type name ‘_TP_EXPROTO_Bool’
In file included from /home/travis/build/qemu/qemu/include/trace.h:4:0,
                 from util/hbitmap.c:16:
./trace/generated-tracers.h: In function ‘trace_e1000e_rx_rss_ip6’:
./trace/generated-tracers.h:8379:431: error: expected string literal before ‘_SDT_ASM_OPERANDS_ipv6_enabled’
./trace/generated-tracers.h:8379:431: error: implicit declaration of function ‘__tracepoint_cb_qemu___e1000e_rx_rss_ip6’ [-Werror=implicit-function-declaration]
./trace/generated-tracers.h:8379:431: error: nested extern declaration of ‘__tracepoint_cb_qemu___e1000e_rx_rss_ip6’ [-Werror=nested-externs]
cc1: all warnings being treated as errors
make: *** [util/hbitmap.o] Error 1

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
---
 hw/net/e1000e_core.c | 11 +++++++++--
 trace-events         |  3 ++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index 6a44ea1..4549acb 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -523,8 +523,15 @@ e1000e_rss_get_hash_type(E1000ECore *core, struct NetRxPkt *pkt)
         bool ex_dis = core->mac[RFCTL] & E1000_RFCTL_IPV6_EX_DIS;
         bool new_ex_dis = core->mac[RFCTL] & E1000_RFCTL_NEW_IPV6_EXT_DIS;
 
-        trace_e1000e_rx_rss_ip6(core->mac[RFCTL],
-                                ex_dis, new_ex_dis, istcp,
+        /*
+         * Following two traces must not be combined because resulting
+         * event will have 11 arguments totally and some trace backends
+         * (at least "ust") have limitation of maximum 10 arguments per
+         * event. Events with more arguments fail to compile for
+         * backends like these.
+         */
+        trace_e1000e_rx_rss_ip6_rfctl(core->mac[RFCTL]);
+        trace_e1000e_rx_rss_ip6(ex_dis, new_ex_dis, istcp,
                                 ip6info->has_ext_hdrs,
                                 ip6info->rss_ex_dst_valid,
                                 ip6info->rss_ex_src_valid,
diff --git a/trace-events b/trace-events
index 68ebac9..c50b870 100644
--- a/trace-events
+++ b/trace-events
@@ -2064,7 +2064,8 @@ e1000e_rx_rss_started(void) "Starting RSS processing"
 e1000e_rx_rss_disabled(void) "RSS is disabled"
 e1000e_rx_rss_type(uint32_t type) "RSS type is %u"
 e1000e_rx_rss_ip4(bool isfragment, bool istcp, uint32_t mrqc, bool tcpipv4_enabled, bool ipv4_enabled) "RSS IPv4: fragment %d, tcp %d, mrqc 0x%X, tcpipv4 enabled %d, ipv4 enabled %d"
-e1000e_rx_rss_ip6(uint32_t rfctl, bool ex_dis, bool new_ex_dis, bool istcp, bool has_ext_headers, bool ex_dst_valid, bool ex_src_valid, uint32_t mrqc, bool tcpipv6_enabled, bool ipv6ex_enabled, bool ipv6_enabled) "RSS IPv6: rfctl 0x%X, ex_dis: %d, new_ex_dis: %d, tcp %d, has_ext_headers %d, ex_dst_valid %d, ex_src_valid %d, mrqc 0x%X, tcpipv6 enabled %d, ipv6ex enabled %d, ipv6 enabled %d"
+e1000e_rx_rss_ip6_rfctl(uint32_t rfctl) "RSS IPv6: rfctl 0x%X"
+e1000e_rx_rss_ip6(bool ex_dis, bool new_ex_dis, bool istcp, bool has_ext_headers, bool ex_dst_valid, bool ex_src_valid, uint32_t mrqc, bool tcpipv6_enabled, bool ipv6ex_enabled, bool ipv6_enabled) "RSS IPv6: ex_dis: %d, new_ex_dis: %d, tcp %d, has_ext_headers %d, ex_dst_valid %d, ex_src_valid %d, mrqc 0x%X, tcpipv6 enabled %d, ipv6ex enabled %d, ipv6 enabled %d"
 e1000e_rx_rss_dispatched_to_queue(int queue_idx) "Packet being dispatched to queue %d"
 
 e1000e_rx_metadata_protocols(bool isip4, bool isip6, bool isudp, bool istcp) "protocols: ip4: %d, ip6: %d, udp: %d, tcp: %d"
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] e1000e: Fix build with ust trace backend
  2016-06-02 19:12 [Qemu-devel] [PATCH] e1000e: Fix build with ust trace backend Dmitry Fleytman
@ 2016-06-03 11:03 ` Peter Maydell
  2016-06-03 13:47   ` Peter Maydell
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2016-06-03 11:03 UTC (permalink / raw)
  To: Dmitry Fleytman
  Cc: QEMU Developers, Jason Wang, Yan Vugenfirer, Leonid Bloch,
	Shmulik Ladkani

On 2 June 2016 at 20:12, Dmitry Fleytman <dmitry@daynix.com> wrote:
> ust trace backend has limitation of maximum 10
> arguments per event. Traces with more arguments
> cannot be compiled for this backend.
>
> Trace e1000e_rx_rss_ip6 introduced by previous
> commits has 11 arguments and fails to compile with
> ust trace backend.
>
> This patch fixes the problem by splitting this
> tracepoint into two successive tracepoints with
> smaller number of arguments.

Thanks, applied to master as a build fix.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] e1000e: Fix build with ust trace backend
  2016-06-03 11:03 ` Peter Maydell
@ 2016-06-03 13:47   ` Peter Maydell
  2016-06-04  7:03     ` Dmitry Fleytman
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2016-06-03 13:47 UTC (permalink / raw)
  To: Dmitry Fleytman
  Cc: QEMU Developers, Jason Wang, Yan Vugenfirer, Leonid Bloch,
	Shmulik Ladkani

On 3 June 2016 at 12:03, Peter Maydell <peter.maydell@linaro.org> wrote:
> Thanks, applied to master as a build fix.

...which reveals another build issue:

https://travis-ci.org/qemu/qemu/jobs/135006245

hw/net/e1000e.c: In function ‘e1000e_io_write’:
hw/net/e1000e.c:170:39: error: ‘idx’ may be used uninitialized in this
function [-Werror=uninitialized]
hw/net/e1000e.c: In function ‘e1000e_io_read’:
hw/net/e1000e.c:145:35: error: ‘idx’ may be used uninitialized in this
function [-Werror=uninitialized]

Combination of ust tracing backend plus gcc 4.6.3
having a tendency to used-uninitialized false positives?

The code itself looks fine so I think this is going to be
a case of adding an initialization somewhere to shut the
compiler up.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] e1000e: Fix build with ust trace backend
  2016-06-03 13:47   ` Peter Maydell
@ 2016-06-04  7:03     ` Dmitry Fleytman
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Fleytman @ 2016-06-04  7:03 UTC (permalink / raw)
  To: Peter Maydell
  Cc: QEMU Developers, Jason Wang, Yan Vugenfirer, Leonid Bloch,
	Shmulik Ladkani


> On 3 Jun 2016, at 16:47 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> 
> On 3 June 2016 at 12:03, Peter Maydell <peter.maydell@linaro.org> wrote:
>> Thanks, applied to master as a build fix.
> 
> ...which reveals another build issue:
> 
> https://travis-ci.org/qemu/qemu/jobs/135006245
> 
> hw/net/e1000e.c: In function ‘e1000e_io_write’:
> hw/net/e1000e.c:170:39: error: ‘idx’ may be used uninitialized in this
> function [-Werror=uninitialized]
> hw/net/e1000e.c: In function ‘e1000e_io_read’:
> hw/net/e1000e.c:145:35: error: ‘idx’ may be used uninitialized in this
> function [-Werror=uninitialized]
> 
> Combination of ust tracing backend plus gcc 4.6.3
> having a tendency to used-uninitialized false positives?
> 
> The code itself looks fine so I think this is going to be
> a case of adding an initialization somewhere to shut the
> compiler up.

Hi Peter,

I just sent patch to fix this to the mailing list.

Regards,
Dmitry

> 
> thanks
> -- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-04  7:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-02 19:12 [Qemu-devel] [PATCH] e1000e: Fix build with ust trace backend Dmitry Fleytman
2016-06-03 11:03 ` Peter Maydell
2016-06-03 13:47   ` Peter Maydell
2016-06-04  7:03     ` Dmitry Fleytman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).