Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3467629imu; Sun, 11 Nov 2018 15:47:04 -0800 (PST) X-Google-Smtp-Source: AJdET5fYyhfacsRXZ0nB+pIbJX8nAjkRzhZM8uXIbhc2xuvxCrxg0r/V+tqKYcrLgMaQa5t+yKvV X-Received: by 2002:a63:de4c:: with SMTP id y12mr15474274pgi.198.1541980024816; Sun, 11 Nov 2018 15:47:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980024; cv=none; d=google.com; s=arc-20160816; b=P3W0+5b5kScFHIrRmOJAqUSZPMnZAh0IdqpCBPdeRfekyratC/WMiW7p4YhZnW+QxN EWRugNN2dGYWjW2lGno23LV+kmyaNWgixzVeTaLnxturEdQUrWE9UJ9z7BW2c4x5Fhx7 6Kq3r8a4Jm5LtbvI6AwdFJeIlgnfKFIuHvsqya7y8+Vupc7sFBJmpalWBleZ0+2DxEA8 8bLyvWx/FIx7nYUlL4so6pPfWE6o36RdqDwWFOuru9Siddka7NFXIoZAGy2CcpJy4mPv vi3X18TlhXWnhxfHuhtqG42jDi+XwMOA35Qt9AEmgLcnkY2BuRGZiaSjX+3WKHYotS1P 5+JA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4O6NOlvU2MUpu7PKYj0iFpMZ8oQ3rDuYXVM8oahPWuk=; b=V00w85wDO2YyVyU1JyMbeyI+jXo9AXbHA1ew6e0tNLJlUrTiCae9T7Nu1fPCnn7uOz p7Gv/9PfR4mG1XjcXK6k/xy80BgCLpA+pySrqCljU7cCby4DZRrVlKL41tRDaK4duFMR yhfPdL2Lc+A98+CMVeNzQfHrpw3eaj4ZI0OEeG6rSYLXwGkwAaSPrL0AhyaYldGTwDQ6 a88mtSjtqu32Ar9PQ+K4YJxdRpXz4vrWtMMj84oZd3hIaKGmA0SaXn10+poN19s7g+iw MjPsF8PfaPSnZzqUZd8xFP6JE6lMgHenAym+FOoFgnWBKopXtja+OhLUhQmvSpQI+cMG F1qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Nj2jVj/x"; 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 u11-v6si14658057pgh.55.2018.11.11.15.46.49; Sun, 11 Nov 2018 15:47:04 -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; dkim=pass header.i=@kernel.org header.s=default header.b="Nj2jVj/x"; 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 S2387497AbeKLJgq (ORCPT + 99 others); Mon, 12 Nov 2018 04:36:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:39684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730330AbeKLITB (ORCPT ); Mon, 12 Nov 2018 03:19:01 -0500 Received: from localhost (unknown [206.108.79.134]) (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 0E670208A3; Sun, 11 Nov 2018 22:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975345; bh=FU6rwPi4QsYhX3tal/NH5BXn1uyR2hn3xZ2FyPqtRgs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nj2jVj/x5g7jOiIKqHiubHKClQ1gCQfXOnkaDGIRExKWhmJOgcYkjK5Sn4x4oHgrd ynTbzfhT84CgroCKd76GPGVvatWa0RbQkUtgvdgfhGDpzoxCjaTGog7R9BB2l25t07 oFvJvFTFzqJ69qoN8ciCO8LLt1C3eIs0+cnDj0q0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Zanussi , Shuah Khan , Rajvi Jingar , Masami Hiramatsu , "Steven Rostedt (VMware)" Subject: [PATCH 4.19 325/361] tracing: Return -ENOENT if there is no target synthetic event Date: Sun, 11 Nov 2018 14:21:12 -0800 Message-Id: <20181111221659.409469592@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masami Hiramatsu commit 18858511fd8a877303cc34c06efa461b26a0e070 upstream. Return -ENOENT error if there is no target synthetic event. This notices an operation failure to user as below; # echo 'wakeup_latency u64 lat; pid_t pid;' > synthetic_events # echo '!wakeup' >> synthetic_events sh: write error: No such file or directory Link: http://lkml.kernel.org/r/154013449986.25576.9487131386597290172.stgit@devbox Acked-by: Tom Zanussi Tested-by: Tom Zanussi Cc: Shuah Khan Cc: Rajvi Jingar Cc: stable@vger.kernel.org Fixes: 4b147936fa50 ('tracing: Add support for 'synthetic' events') Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_events_hist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -1063,8 +1063,10 @@ static int create_synth_event(int argc, event = NULL; ret = -EEXIST; goto out; - } else if (delete_event) + } else if (delete_event) { + ret = -ENOENT; goto out; + } if (argc < 2) { ret = -EINVAL;