Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2033159imm; Wed, 16 May 2018 06:56:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqTmgEVZ18GR4/gF4+fGvmQfcQLBiaIS4kzfFYYRMxNLVIoOrx63+ylJKlq5kC69U9pkNNt X-Received: by 2002:a17:902:268:: with SMTP id 95-v6mr1088219plc.386.1526479012820; Wed, 16 May 2018 06:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526479012; cv=none; d=google.com; s=arc-20160816; b=EUS/eyqSGFgWZeu2XadF4A/K5//h9YsVUuKR1F9FgLm9sjjnNJjQMxEtcg4/Eb+TKI pwoMiimhAwG93vJSBwB94M2NFbQwWgwTZ+Y8w7X3VoBcHlxcW3RlEk+LFbi9kn4/Iseb lw37LSezVMuGRJrO8LgGnv261Gl0S8eSm/9OXTN6kFmMGaiGeXPwHwAzAuWeVORRpuk5 KIHv4HkzHRY8pofiCeWo5TTrM5KN/c+NgXkbLiRhnBL5rRYYt+JNlVBnyT+Upuiqu7mp 2/h9LfWBUkmDxh2ISzHOau6uWH9OlZVUaci69oqwgvYOSVDzHgWKNskQLbguXZw3HRmu r9OA== 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 :arc-authentication-results; bh=cHyWYIzyqZHb2MFV3TU+E1kvXPEs6ZO07c0WHstUayw=; b=aVapQRdnKe1/7AnAur6a1NteN5O/EjJTt3ZMh8TwwalVV0Bf2zL/CUaM/zkNshFtVZ GkBrt4o9FCRo3jK0f7R4SLOL2mYJXHNp5IjuYQSwydpMsuKZMTRIp2iSd+WG48rjrFqR n6uEShCf/Zu3mS4FojNeA74fKxprnswmpWssAQYZ6wlqXk/bIbRi6e8VDs4G+KI5i4de i6jCqEP8OxEZNV+xwcEpVnllkhXlQnAJFJYYPiyoOymGqvSlRdhCl6m+6oTFoXL/FfOR 8ZVE+61TgxsG5fLizaLVhEv7Ub+2zqxyCY9gRqYnuEVuQ62oII6LBdFqx4qbrgJcCutA ZwbQ== 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 38-v6si2627888pln.390.2018.05.16.06.56.38; Wed, 16 May 2018 06:56:52 -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 S1752599AbeEPNzk (ORCPT + 99 others); Wed, 16 May 2018 09:55:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:36922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751395AbeEPNzi (ORCPT ); Wed, 16 May 2018 09:55:38 -0400 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 5FABF20834; Wed, 16 May 2018 13:55:36 +0000 (UTC) Date: Wed, 16 May 2018 09:55:34 -0400 From: Steven Rostedt To: Tom Zanussi Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Thomas Gleixner , Clark Williams , Karim Yaghmour , Brendan Gregg , Joel Fernandes , Masami Hiramatsu , Namhyung Kim , Yann Ylavic , linux-rt-users@vger.kernel.org Subject: Re: [PATCH v2 10/14] tracing: Document trace_marker triggers Message-ID: <20180516095534.676d7938@gandalf.local.home> In-Reply-To: <1526334427.26800.15.camel@tzanussi-mobl.amr.corp.intel.com> References: <20180514205845.017925650@goodmis.org> <20180514205958.769987842@goodmis.org> <1526334427.26800.15.camel@tzanussi-mobl.amr.corp.intel.com> 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: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 14 May 2018 16:47:07 -0500 Tom Zanussi wrote: > Hi Steve, > > This is a nice new event feature - thanks for doing it! Some minor typo > comments below.. Can I get an Acked-by from you? > > +3. User space creating a trigger > > +-------------------------------- > > + > > +Writing into /sys/kernel/tracing/trace_marker writes into the ftrace > > +ring buffer. This can also act like an event, by writing into the trigger > > +file located in /sys/kernel/tracing/events/ftrace/print/ > > + > > +Modifying cyclictest to write into the trace_marker file before it sleeps > > +and after it wakes up, something like this: > > + > > +static void traceputs(char *str) > > +{ > > + /* tracemark_fd is the trace_marker file descripto */ > > > > Should be 'descriptor'? Fixed. > > + # ./cyclictest -p80 -d0 -i250 -n -a -t --tracemark -b 1000 > > + > > + -p80 : run threads at priority 80 > > + -d0 : have all threads run at the same interval > > + -i250 : start the interval at 250 microseconds (all threads will do this) > > + -n : sleep with nanosleep > > + -a : affine all threads to a separate CPU > > + -t : one thread per available CPU > > + --tracemark : enable trace mark writing > > + -b 1000 : stop if any latency is greater than 1000 microseconds > > + > > +Note, the -b 1000 is used just to make --tracemark available. > > + > > +The we can see the histogram created by this with: > > + > > 'Then we can.. Fixed > > +The difference this time is that instead of using the trace_marker to start > > +the latency, the sched_waking event is used, matching the common_pid for the > > +trace_marker write with the pid that is being worken by sched_waking. > > > > s/worken/woken ? Fixed. (It's kind of like Borken) > > > > > + > > +After running cyclictest again with the same parameters, we now have: > > + > > + # cat events/synthetic/latency/hist > > +# event histogram > > +# > > +# trigger info: hist:keys=lat,common_pid:vals=hitcount:sort=lat:size=2048 [active] > > +# > > + > > +{ lat: 7, common_pid: 2302 } hitcount: 640 > > > > snip > > > > > +{ lat: 61, common_pid: 2302 } hitcount: 1 > > +{ lat: 110, common_pid: 2302 } hitcount: 1 > > + > > +Totals: > > + Hits: 89565 > > + Entries: 158 > > + Dropped: 0 > > + > > +This doesn't tell us any information about how late cyclictest may have > > +worken up, but it does show us a nice histogram of how long it took from > > +the time that cyclictest was worken to the time it made it into user space. > > > > A couple more that don't seem to be 'worken' ;-) I have an itchy 'r' finger. Thanks for the review, I just updated this. Oh, I guess I think I prefer a "Reviewed-by" tag instead of Ack (gives a stronger meaning). -- Steve