Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1556620pxy; Thu, 29 Apr 2021 09:23:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU+A5E3f3I05CcJse0mVr9nqb+okCYl3whqsrPn+FImdu1TgjKP95asN2kkPXatsdHfT0i X-Received: by 2002:a17:90a:c781:: with SMTP id gn1mr630124pjb.205.1619713415554; Thu, 29 Apr 2021 09:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619713415; cv=none; d=google.com; s=arc-20160816; b=LGcX8IhZKRc4jFsSGkgVRTxmPu+kn8D8F9krtp9X9d+UgKc7IIfGp4kpCbojDDcjHX gEuUjpV6d+1uqOrjFDBUyxPfdgyGUgkB54xtlm6prufP5VIuP0pyaIuSPYz8DNCb7fxI bmbJm6yiZlMhIjmqYTOQqa+tcRlNMAjATzLfBco6KqQuCYgRJVRa2lNKaA1+V45YTYnA 8pTZG/xs4RQsuwo+AiuTumeAE+hlqu4R1CD5KKPKTXKxug8fw8T6whUD1Neyow4ZbVBy R1Kxk9yFMA5SSMXHWotl3HbuaqYQwamvNdz8kbQsaROxfadSYkRJ8KtPQTSuw2qGuH3E sYbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=BCKw520guZPkz7v7WVJ5VwPjTGQx4iUmdhnDygzU68w=; b=QAdxDEXq8c170YWNH0/pe6H50+DeiK5AFA3hfOsvPX05zWEilyUXkGJvUjcxdV0EZa mUFwvV0VlzicMHp3lU8fduEKWDOunIEd3e7uBJmqzl/64ElN+tDE4uRWoNEQyUdZs9MT xEruQCGv2z1e62sC0Zy0KnLLTrAD974+SvOF50qBKBhjONgATVdXYZQ8/jOmR3uT7Ibx YTOl3uW1eTHm4vKQZentE2iwy0vZyf2tPV78gP6Q6ySd832MFV+t9erAWmfluMEad4ut 65WKPQ4My2horBWHd7ni2uI+y9vBK105NLfwvB9gxiQybcYE8FSJf08kyAsYCkUmBd6J PSFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i18si389546pgg.184.2021.04.29.09.23.06; Thu, 29 Apr 2021 09:23:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233846AbhD2QXU (ORCPT + 99 others); Thu, 29 Apr 2021 12:23:20 -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.