Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1141059imu; Fri, 9 Nov 2018 11:36:10 -0800 (PST) X-Google-Smtp-Source: AJdET5coZ3nxNqYLI2Atk1d9iIxS1bLKHhQ1o0Z0mbblAedjOuy0v8/QBNjgnVmX+ZMAyBoxQcEB X-Received: by 2002:a63:6bc1:: with SMTP id g184mr8765849pgc.25.1541792170786; Fri, 09 Nov 2018 11:36:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541792170; cv=none; d=google.com; s=arc-20160816; b=v+SmZXJox5/yV1mqmUiUxO1r8a90Sc0gP3QtAjXjhP2bWiJIhN+INGZ0mA7G9ne9mk TVfYjz5VfRPFYzx1ycIKmVeKDJbmNhrW6nRzyUwO0A7NLjzUWz3e9KNtXFdoMwXWflf6 yAIf3v7C8Fz8vLSZ0pfUtz4EghHq7CY/GwINMRa6rXipeU6S45H4kYlZacH0Tiy5MZQL TMBRzd1wIGCZHQqlU8+cR5Y7fpJ3aijES8aFtg9UOhlXP1p6Xh7nr65TeTS5hlPS43Jv vFhaMV9RMtHrNBrN5KaXESxjS5A0vbFVZjLQNSZDQMrPM2ush0+fCAydeuhwkIxOm8GE LD1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=m6J2a9GoO1jmCnV/wdlF75bz18qcgE6yscx/L4+GX/4=; b=P4hDybcOdodNP5A299/gB45xKKC7EhJBbmiItNJBtI85cYgKbY4YLjkzt/o3PZ6Xot nQnvyi/sh6j5ySEvY5T3YiWTvSRqojECWJxmGHppr6bpcGPvROXndg/CBVi4aB0nyaNE 0AKuAJlBxj6fVKu9r+IRPOwe+9b4rGd4dpVHrE3+MS9IosDPNaJ+8/kOjPOL2Ts3jG5R s7xJfAXsjIlpHKMeIx4e7gXUMcM1vVl+DEzGF4cAyz6Gxos12B3DfH9KnCKZdvJOL8Ts n9yWHs8XjCb1VaS8e9Ms6jSTeK1nuj/pr7VE3eqcgwflCY9v9bwHE0IeGIodKjC0kYLE G/xQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a12si8156285pgk.291.2018.11.09.11.35.49; Fri, 09 Nov 2018 11:36:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727017AbeKJFOR convert rfc822-to-8bit (ORCPT + 99 others); Sat, 10 Nov 2018 00:14:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:45204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725752AbeKJFOR (ORCPT ); Sat, 10 Nov 2018 00:14:17 -0500 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 540B520825; Fri, 9 Nov 2018 19:32:16 +0000 (UTC) Date: Fri, 9 Nov 2018 14:32:14 -0500 From: Steven Rostedt To: "Matwey V. Kornilov" Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, matwey.kornilov@gmail.com, tfiga@chromium.org, laurent.pinchart@ideasonboard.com, stern@rowland.harvard.edu, ezequiel@collabora.com, hdegoede@redhat.com, hverkuil@xs4all.nl, mchehab@kernel.org, mingo@redhat.com, isely@pobox.com, bhumirks@gmail.com, colin.king@canonical.com, kieran.bingham@ideasonboard.com, keiichiw@chromium.org Subject: Re: [PATCH v6 1/2] media: usb: pwc: Introduce TRACE_EVENTs for pwc_isoc_handler() Message-ID: <20181109143214.317bf6e2@gandalf.local.home> In-Reply-To: <20181109190327.23606-2-matwey@sai.msu.ru> References: <20181109190327.23606-1-matwey@sai.msu.ru> <20181109190327.23606-2-matwey@sai.msu.ru> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 9 Nov 2018 22:03:26 +0300 "Matwey V. Kornilov" wrote: > There were reports that PWC-based webcams don't work at some > embedded ARM platforms. [1] Isochronous transfer handler seems to > work too long leading to the issues in MUSB USB host subsystem. > Also note, that urb->giveback() handlers are still called with > disabled interrupts. In order to be able to measure performance of > PWC driver, traces are introduced in URB handler section. > > [1] https://www.spinics.net/lists/linux-usb/msg165735.html From a tracing perspective, I don't see anything wrong with this patch. Reviewed-by: Steven Rostedt (VMware) -- Steve > > Signed-off-by: Matwey V. Kornilov > --- > drivers/media/usb/pwc/pwc-if.c | 7 +++++ > include/trace/events/pwc.h | 65 ++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 72 insertions(+) > create mode 100644 include/trace/events/pwc.h > > diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c > index 72704f4d5330..53c111bd5a22 100644 > --- a/drivers/media/usb/pwc/pwc-if.c > +++ b/drivers/media/usb/pwc/pwc-if.c > @@ -76,6 +76,9 @@ > #include "pwc-dec23.h" > #include "pwc-dec1.h" > > +#define CREATE_TRACE_POINTS > +#include > + > /* Function prototypes and driver templates */ > > /* hotplug device table support */ > @@ -260,6 +263,8 @@ static void pwc_isoc_handler(struct urb *urb) > int i, fst, flen; > unsigned char *iso_buf = NULL; > > + trace_pwc_handler_enter(urb, pdev); > + > if (urb->status == -ENOENT || urb->status == -ECONNRESET || > urb->status == -ESHUTDOWN) { > PWC_DEBUG_OPEN("URB (%p) unlinked %ssynchronously.\n", > @@ -348,6 +353,8 @@ static void pwc_isoc_handler(struct urb *urb) > } > > handler_end: > + trace_pwc_handler_exit(urb, pdev); > + > i = usb_submit_urb(urb, GFP_ATOMIC); > if (i != 0) > PWC_ERROR("Error (%d) re-submitting urb in pwc_isoc_handler.\n", i); > diff --git a/include/trace/events/pwc.h b/include/trace/events/pwc.h > new file mode 100644 > index 000000000000..a2da764a3b41 > --- /dev/null > +++ b/include/trace/events/pwc.h > @@ -0,0 +1,65 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#if !defined(_TRACE_PWC_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_PWC_H > + > +#include > +#include > + > +#undef TRACE_SYSTEM > +#define TRACE_SYSTEM pwc > + > +TRACE_EVENT(pwc_handler_enter, > + TP_PROTO(struct urb *urb, struct pwc_device *pdev), > + TP_ARGS(urb, pdev), > + TP_STRUCT__entry( > + __field(struct urb*, urb) > + __field(struct pwc_frame_buf*, fbuf) > + __field(int, urb__status) > + __field(u32, urb__actual_length) > + __field(int, fbuf__filled) > + __string(name, pdev->v4l2_dev.name) > + ), > + TP_fast_assign( > + __entry->urb = urb; > + __entry->fbuf = pdev->fill_buf; > + __entry->urb__status = urb->status; > + __entry->urb__actual_length = urb->actual_length; > + __entry->fbuf__filled = (pdev->fill_buf > + ? pdev->fill_buf->filled : 0); > + __assign_str(name, pdev->v4l2_dev.name); > + ), > + TP_printk("dev=%s (fbuf=%p filled=%d) urb=%p (status=%d actual_length=%u)", > + __get_str(name), > + __entry->fbuf, > + __entry->fbuf__filled, > + __entry->urb, > + __entry->urb__status, > + __entry->urb__actual_length) > +); > + > +TRACE_EVENT(pwc_handler_exit, > + TP_PROTO(struct urb *urb, struct pwc_device *pdev), > + TP_ARGS(urb, pdev), > + TP_STRUCT__entry( > + __field(struct urb*, urb) > + __field(struct pwc_frame_buf*, fbuf) > + __field(int, fbuf__filled) > + __string(name, pdev->v4l2_dev.name) > + ), > + TP_fast_assign( > + __entry->urb = urb; > + __entry->fbuf = pdev->fill_buf; > + __entry->fbuf__filled = pdev->fill_buf->filled; > + __assign_str(name, pdev->v4l2_dev.name); > + ), > + TP_printk(" dev=%s (fbuf=%p filled=%d) urb=%p", > + __get_str(name), > + __entry->fbuf, > + __entry->fbuf__filled, > + __entry->urb) > +); > + > +#endif /* _TRACE_PWC_H */ > + > +/* This part must be outside protection */ > +#include