From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 950EBC433ED for ; Thu, 29 Apr 2021 16:22:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6874161407 for ; Thu, 29 Apr 2021 16:22:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237212AbhD2QXV (ORCPT ); Thu, 29 Apr 2021 12:23:21 -0400 Received: from mga01.intel.com ([192.55.52.88]:47179 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233622AbhD2QXU (ORCPT ); Thu, 29 Apr 2021 12:23:20 -0400 IronPort-SDR: hX07j0mMjyj3BpL+05bfImCqawop9hHudgluc6H2BPhWkEX5HHWBA8FpBLdnnh612CLv6khFNH dIhyON+ad7Ag== X-IronPort-AV: E=McAfee;i="6200,9189,9969"; a="217777438" X-IronPort-AV: E=Sophos;i="5.82,259,1613462400"; d="scan'208";a="217777438" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2021 09:22:33 -0700 IronPort-SDR: D7BFJIf6n3VEatCpvvMZ/mRomPmaiNQWbwIB1f7qkOoLMXg4I7v0NBfmNoVAKqVVV8s+KcQEON qjpg2g4d7pKg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,259,1613462400"; d="scan'208";a="430920493" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.174]) ([10.237.72.174]) by orsmga008.jf.intel.com with ESMTP; 29 Apr 2021 09:22:31 -0700 Subject: Re: [PATCH 04/12] perf inject: Add facility to do in place update To: Andi Kleen Cc: Arnaldo Carvalho de Melo , Jiri Olsa , linux-kernel@vger.kernel.org References: <20210429125854.13905-1-adrian.hunter@intel.com> <20210429125854.13905-5-adrian.hunter@intel.com> <20210429160003.GC4032392@tassilo.jf.intel.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <25d110ca-7fe4-c8be-f3f3-fdfeaa04cbed@intel.com> Date: Thu, 29 Apr 2021 19:22:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210429160003.GC4032392@tassilo.jf.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/04/21 7:00 pm, Andi Kleen wrote: >> + if (!data.force && !inject.in_place_update_dry_run) { >> + char reply[10]; >> + >> + printf("The input file will be updated in place. OK? (y/n) "); >> + if (!fgets(reply, sizeof(reply), stdin) || strcmp(reply, "y\n")) { > > Interactive questions could break lots of scripting. > > Just error out in this case and require the option. > If it is used with --force (or -f) then there is no prompt.