Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5890437ybp; Tue, 15 Oct 2019 06:37:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPedr6KIve5xKioHBXs/NTlftZsULgoiTzQrJSZGKmLgpBAtYtQfmc335s/8JMrtGqKfE1 X-Received: by 2002:a05:6402:19bd:: with SMTP id o29mr32945729edz.42.1571146641344; Tue, 15 Oct 2019 06:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571146641; cv=none; d=google.com; s=arc-20160816; b=uOgiibj091cWdXwR6Z05toLRoUKr9Cx7eTvtHnCKqFiyiNDyrB9axOAsxhM/atTND9 QSYVGyf0hwCeOttM8wyCCYpzzoXBMJkztE/WEJeYD69szQtraPlwoq/42aeWGtbL4gkO rYTuNXnHIrZXH+puzHYh9UCmLv2RGhEUIQZw0O3vyuhyuUhZ1sEooLjhhC0wk5wg3g2d WkdgdAAdD8+EhPNKnMcTT3DE4EWVNhScVZefUDn1fSK7azTTxxb+JI3WxA3zogWYDT6T aVldVqSFN5gHzcxXjCMfCmbZtsDkWeVRkryW1QOAEdsjcNjVLE1y4/gIcjCYj6vjQkK/ dFPQ== 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=u+FmSwsENxrWk7Eysl37eNcg8+Y19AcKSfGV1tIdRgI=; b=lfn+ESQe/e7TlJSNhBP+jCfL5p5EJBBybzwR7v9Xv66wrsXUXfHfk8pUMEpc+YRmKH F1/r1/qI13g5txYXsnfh8J+VxA/EFcyE//AJOkk05Yz+7TKRhmHtGCOqn3ERglb+5YY7 td0qtcyyuojRTX0x/jQtCMrhnlKD+eujwhmIemiLeccvuE3KinJ0LQMT2zykd9itONqf lQ/k5bVhydOZWKlUg9k3Mwc4kfiUcd5oG6KpOkaDg2okfc+6cS2vtiehldG3D0KfP5CX V+WXR2LSBqIiT2vjfRrCwQEL9+uc5WzrXn1/uNvbpCTRmdU2ML2Oy9LFWdfKa8M1a+IW /3Lw== 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 q17si12845073ejx.139.2019.10.15.06.36.58; Tue, 15 Oct 2019 06:37:21 -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 S1731983AbfJONgq (ORCPT + 99 others); Tue, 15 Oct 2019 09:36:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:32806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728880AbfJONgq (ORCPT ); Tue, 15 Oct 2019 09:36:46 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 855752064A; Tue, 15 Oct 2019 13:36:44 +0000 (UTC) Date: Tue, 15 Oct 2019 09:36:42 -0400 From: Steven Rostedt To: Miroslav Benes Cc: Petr Mladek , jikos@kernel.org, joe.lawrence@redhat.com, jpoimboe@redhat.com, mingo@redhat.com, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v2] ftrace: Introduce PERMANENT ftrace_ops flag Message-ID: <20191015093642.72e872d0@gandalf.local.home> In-Reply-To: References: <20191014105923.29607-1-mbenes@suse.cz> <20191014111719.141bd4fa@gandalf.local.home> <20191015074540.bxehllisibls3kk7@pathway.suse.cz> X-Mailer: Claws Mail 3.17.3 (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 Tue, 15 Oct 2019 12:50:59 +0200 (CEST) Miroslav Benes wrote: > > > > @@ -6752,12 +6764,19 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, > > > > ftrace_startup_sysctl(); > > > > > > > > } else { > > > > + if (is_permanent_ops_registered()) { > > > > + ftrace_enabled = last_ftrace_enabled; > > > > > > Although this is not incorrect, but may be somewhat confusing. > > > > > > At this location, last_ftrace_enabled is always true. > > > > > > I'm thinking this would be better to simply set it to false here. > > > > IMHO, we want to set ftrace_enabled = true here. Yes, I meant true (don't know why I said false :-/ ) > > > > It was set to "false" by writing to the sysfs file. But the change > > gets rejected. ftrace will stay enabled. So, we should set > > the value back to "true". > > That's correct. > > I can make it explicit as proposed. I just thought that 'ftrace_enabled = > last_ftrace_enabled' was clear enough given Petr's explanation. > > > > > + ret = -EBUSY; > > > > + goto out; > > > > + } > > > > + > > > > /* stopping ftrace calls (just send to ftrace_stub) */ > > > > ftrace_trace_function = ftrace_stub; > > > > > > > > ftrace_shutdown_sysctl(); > > > > } > > > > > > > > + last_ftrace_enabled = !!ftrace_enabled; > > > > out: > > > > > > And move the assignment of last_ftrace_enabled to after the "out:" > > > label. > > > > This change might make sense anyway. But it is not strictly necessary > > from my POV. > > If it stays before "out:" label, last_ftrace_enabled is set if and only if > it has to be set. I think it is better, but I can, of course, move it in > v3 if Steven prefers it. I don't have any strong feelings here. If you want to keep it like this, I wont argue. -- Steve