From patchwork Mon Mar 11 08:33:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10846881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 087C414DE for ; Mon, 11 Mar 2019 08:33:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA62928F79 for ; Mon, 11 Mar 2019 08:33:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF08028F7F; Mon, 11 Mar 2019 08:33:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DBAC28F79 for ; Mon, 11 Mar 2019 08:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725850AbfCKIds (ORCPT ); Mon, 11 Mar 2019 04:33:48 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35998 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbfCKIds (ORCPT ); Mon, 11 Mar 2019 04:33:48 -0400 Received: by mail-wm1-f67.google.com with SMTP id j125so3345701wmj.1 for ; Mon, 11 Mar 2019 01:33:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hx45oLWm3cO7y7qj3wq6+r7jPLgvW5RIhXHj5w/9PtQ=; b=JA1xu2IIaFDqOAMLElqsNFLBmGaIvMN+js91geUlvCvjB/MWCbd5vuVCEKbnc7ECG+ CRXWRIS7Kof8EO9E+RapJ1f6SvZC0W5RZaY/Pc3Aa7Hkqh47c0u3jayBIZRvyFxs4avp 5v3Pw9+qNKbJbo1fZLt78UaeMDlTflVIHIBrv93T+UkOGr+IVL+OwRqhFrrDAu21Zght bfGYMAx4M6iaSMiPlqmQ3jbdSMzZA3IcwGo6JWHzeZb118sgy20yGzIIgINKebSoIrQJ nW4gfcpZN4Swoo6R7H4Gl2k8QI2ozhXyj8U6stFTlstxVdK4FkRkvH4cd3bO0gMBbb5G 377g== X-Gm-Message-State: APjAAAU3t4qPWKnx6W8/PZblCpsw7Xrbq7bwhYdFdW+vkmc0FP3Ro27p Js1vvqLmG9uiwcc29NnDNMd6RbPR X-Google-Smtp-Source: APXvYqw9NFwSu6WNbazfb2sxpnJsDnFo9CZlsCWdJpj+E3Ewqdq8u3n/DOmG/jAoY7huSMKTHMuT7g== X-Received: by 2002:a1c:2097:: with SMTP id g145mr15823311wmg.81.1552293226356; Mon, 11 Mar 2019 01:33:46 -0700 (PDT) Received: from oberon.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id x17sm19683835wrd.95.2019.03.11.01.33.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Mar 2019 01:33:45 -0700 (PDT) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 5/6] trace-cmd: Fix "trace-cmd reset" command to restore the default value of set_event_pid Date: Mon, 11 Mar 2019 10:33:38 +0200 Message-Id: <20190311083339.21581-6-tstoyanov@vmware.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311083339.21581-1-tstoyanov@vmware.com> References: <20190311083339.21581-1-tstoyanov@vmware.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The "trace-cmd reset" command should restore ftrace to its default state. This patch sets "tracing/set_event_pid" to an empty string, when the "trace-cmd reset" command is executed. Signed-off-by: Tzvetomir Stoyanov --- tracecmd/trace-record.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c index a398723..bdf0c02 100644 --- a/tracecmd/trace-record.c +++ b/tracecmd/trace-record.c @@ -3796,6 +3796,12 @@ static void reset_clock(void) write_instance_file(instance, "trace_clock", "local", "clock"); } +static void reset_event_pid(void) +{ + add_event_pid(""); +} + + static void clear_triggers(void) { struct buffer_instance *instance; @@ -4499,6 +4505,7 @@ void trace_reset(int argc, char **argv) clear_triggers(); /* set clock to "local" */ reset_clock(); + reset_event_pid(); tracecmd_remove_instances(); clear_func_filters(); /* restore tracing_on to 1 */