Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp7010003imm; Sun, 20 May 2018 16:18:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpG2enZKPfwtdveL2xwKne8oU2vizTgfSIsitnLsq5834NShx6nMtm5VKLFoYCn23vGwQR6 X-Received: by 2002:a63:7317:: with SMTP id o23-v6mr2610167pgc.59.1526858317009; Sun, 20 May 2018 16:18:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526858316; cv=none; d=google.com; s=arc-20160816; b=ZK6SJ5J0RifsvX/7QTS2HfyuUrMEbgbOFxntEHS6TaSo+iBA0wzjj3R77gZGGD2nKg d0NJ+/PICfuSk3iW9/A6AaP77Ozvhq33OPaDojpLTDuHvEwQ4Gxw8ZAc4DtAkb4IeEDd b7Gr4tQ6my7F932SGmSEnzsdjy9ys0ygwwiI0oTOSOWH6Ajdi2AMllgSxWvuttEGl3mc DE/+/29M14IXk8deeF8l6TgQYpZqfpnRAfrW50n2CWFH89h44U5eazHLPTAVauxO33iM iHd0VeA7+IB/D75E4EJwEc1Wf84QXk11no2B3tRZPHFNaOUZvbxG5HdMbX87daRJGGY1 F2hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=ZKI9i2u7HdzcO1vrREVMBeKTxvpnVXQQNMEYLptfk5A=; b=hKIcR+htu6fAqxDQ+I288YM0JTNu4b4cDGL8WTCg2jZlOkdhOC7/uhTRSA+nioKgXK tAKY20vqHVf9I2NLVQwQa43BaNz4Lt1gipv6BnYfteTvA0ByKmaImieEslZmnCBGKG6A 05ZF32qG6XSxFJo36YnV+HvTIKD2s6DOy5+Sz2am7mrAn33rxX5YTlQm5+Gs7IirlTVK L9zTUR2ZgG+DT/Up5Ub/QlXQHIs6nQlotNGX86Cw8QY6LH7wWFE86blzhXnsCbHqt1n7 W5vc0RD7VfRegcj280K6aPC4B7uget+hHE++u1Mn1GEdC9GjelaY8hVYqH5O4DJiArXS irqQ== 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 d7-v6si13015240pfe.214.2018.05.20.16.18.22; Sun, 20 May 2018 16:18:36 -0700 (PDT) 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 S1752572AbeETXRz (ORCPT + 99 others); Sun, 20 May 2018 19:17:55 -0400 Received: from ipmail02.adl2.internode.on.net ([150.101.137.139]:48258 "EHLO ipmail02.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751650AbeETXRs (ORCPT ); Sun, 20 May 2018 19:17:48 -0400 Received: from ppp59-167-129-252.static.internode.on.net (HELO dastard) ([59.167.129.252]) by ipmail02.adl2.internode.on.net with ESMTP; 21 May 2018 08:47:45 +0930 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1fKXaC-0004Xr-Sb; Mon, 21 May 2018 09:17:44 +1000 Date: Mon, 21 May 2018 09:17:44 +1000 From: Dave Chinner To: Steve French Cc: Ralph =?iso-8859-1?Q?B=F6hme?= , CIFS , LKML , samba-technical , linux-fsdevel Subject: Re: [PATCHv2][SMB3] Add kernel trace support Message-ID: <20180520231744.GM10363@dastard> References: <20180518184630.axfa7oq4pewb7foj@kazak> <20180519232257.GL10363@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 19, 2018 at 08:56:39PM -0500, Steve French wrote: > On Sat, May 19, 2018 at 6:22 PM, Dave Chinner wrote: > > On Fri, May 18, 2018 at 01:43:14PM -0700, Steve French wrote: > >> On Fri, May 18, 2018 at 11:46 AM, Ralph B?hme wrote: > >> > On Thu, May 17, 2018 at 09:36:36PM -0500, Steve French via samba-technical wrote: > >> >> Patch updated with additional tracepoint locations and some formatting > >> >> improvements. There are some obvious additional tracepoints that could > >> >> be added, but this should be a reasonable group to start with. > >> >> > >> >> From edc02d6f9dc24963d510c7ef59067428d3b082d3 Mon Sep 17 00:00:00 2001 > >> >> From: Steve French > >> >> Date: Thu, 17 May 2018 21:16:55 -0500 > >> >> Subject: [PATCH] smb3: Add ftrace tracepoints for improved SMB3 debugging > >> >> > >> >> Although dmesg logs and wireshark network traces can be > >> >> helpful, being able to dynamically enable/disable tracepoints > >> >> (in this case via the kernel ftrace mechanism) can also be > >> >> helpful in more quickly debugging problems, and more > >> >> selectively tracing the events related to the bug report. > >> >> > >> >> This patch adds 12 ftrace tracepoints to cifs.ko for SMB3 events > >> >> in some obvious locations. Subsequent patches will add more > >> >> as needed. > >> >> > >> >> Example use: > >> >> trace-cmd record -e cifs > >> >> > >> >> trace-cmd show > >> > > >> > pardon my ignorance, but are these tracepoints usable with other tracing > >> > frameworks like Systemtap? > >> > > >> > Last time I checked, Systemtap looked like *the* tool. > > > > Systemtap is great when you have a need for custom tracing. But for > > day-to-day kernel development, tracepoints are far more useful > > because they are always there and can cover all the common > > situations that you need to trace. > > > > And when it comes to debugging a one-off user problem when the user > > knows nothing about systemtap? Nothing beats asking the user > > to run a trace on built-in tracepoints, reproduce the problem and > > send the trace report back as per the above example. > > Yep - it has already been helpful in debugging problems. > > Main problem I hit using the new tracepoints over the past few days > was entries being discarded from the buffer - I had a counter leak (now > fixed) that xfstest showed ... but about 90% of the entries were dropped. > Tried increasing buffer size but might have made things worse not better. > Ideas how to force more entries to be saved? The only tends to be a problem when you are generating events faster than userspace can drain the kernel ring buffer. Generally speaking, this happens when you try to trace too many events for userspace to drain in the CPU time the kernel assigns it. I'm guessing that tracing an interrupt driven workload like a network protocol this is going to be more of a problem than filesystems - it's the perennial "tcpdump/wireshark/etc cannot keep up with the incoming packet rate" problem - increasing buffer sizes never fixes that problem. :) Storing the trace data output file on tmpfs can be helpful here, as can reducing the number of events to just the layer you need info from, filter the specific events you want to see (e.g. filter by client/server connection, by process/CPU, etc), set up trigger events so tracing doesn't start until you want it to, etc... Cheers, Dave. -- Dave Chinner david@fromorbit.com