Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2805168pxv; Sun, 27 Jun 2021 09:19:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVTGrco6bB24IXnJOY7CmerfCFTKZYDLsJBOxQQefi8s+nD4/DZWp7dkiUeh5U5NiES5D7 X-Received: by 2002:aa7:c3d6:: with SMTP id l22mr27990743edr.245.1624810781612; Sun, 27 Jun 2021 09:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624810781; cv=none; d=google.com; s=arc-20160816; b=hgTetG9vKNZl/Izney6y0YWbRGLk7oTMBKxUhwR40KYIgj+e8fa/lzz0UEV3Aivlka Rp0VyWUOCIsV2yveR+r287Idpw1IScla0QQFFuoO3bYoHc0uou3JPAvofrOx30scAlr2 j5OvHozgBFWA1i+a0z89mc+pJC/zFNviCHpEb+nCIyNo32UX3cpVtbJLTn6ajHqsSRFL M2DGRn5+cdqJjiL8gMmRwdR6bATpLUbanQ50YgK7xevvSRN063aHbvY6e1sUq4HuBumu gOb5Hf1ck1yCX29vs+xCLwlth+mjjZsgmpK8ERsCIdJie8jbmmaD9o0UNEPdFGY2W01s Vlxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=UgBHtpXjyokgqG9Q39yHHfT4v5Vn2T/eiltGZkdTnAA=; b=r9kWLtUf1O2mNngabBNvbSkh4Ni06H9GmxjnAbqSnEguxDM3maeQMnlJWZwPvpnJUx kWlGz2549RUkoiqoIn7lAAdxdXDQjlNMiTz5i5+B+RJSb7Gg4cN/6XJn1+pENeZb2Trv d+HX6jDzdNlQiWS+wdzLENIovxJXNsIWljemGAN+aFYcfsAllphwAuwWqWNLZh597LIu sZ8Wr/T2PBszOy3dDDYGMsuEWcGS1J6XI74tNX/D06RyyY+V1kQrHYPXbWvg6XNqZfcO JeqOF2FFhR/Z5ZcKqK5TbrJ1jhAtvMacylqyrKbdL3HR9bfelgj5vEMDoFjcpODjoEVm V+HQ== 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 el9si12051683ejc.96.2021.06.27.09.18.54; Sun, 27 Jun 2021 09:19:41 -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 S230334AbhF0QPo (ORCPT + 99 others); Sun, 27 Jun 2021 12:15:44 -0400 Received: from mga02.intel.com ([134.134.136.20]:52163 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229820AbhF0QPo (ORCPT ); Sun, 27 Jun 2021 12:15:44 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10028"; a="194998132" X-IronPort-AV: E=Sophos;i="5.83,304,1616482800"; d="scan'208";a="194998132" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2021 09:13:07 -0700 X-IronPort-AV: E=Sophos;i="5.83,304,1616482800"; d="scan'208";a="624994541" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.212.138.183]) ([10.212.138.183]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2021 09:13:06 -0700 Subject: Re: [PATCH V2 00/10] perf script: Add API for filtering via dynamically loaded shared object To: Adrian Hunter , Arnaldo Carvalho de Melo Cc: Jiri Olsa , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Leo Yan , Kan Liang , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210627131818.810-1-adrian.hunter@intel.com> From: Andi Kleen Message-ID: Date: Sun, 27 Jun 2021 09:13:06 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210627131818.810-1-adrian.hunter@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/27/2021 6:18 AM, Adrian Hunter wrote: > Hi > > In some cases, users want to filter very large amounts of data (e.g. from > AUX area tracing like Intel PT) looking for something specific. While > scripting such as Python can be used, Python is 10 to 20 times slower than > C. So define a C API so that custom filters can be written and loaded. While I appreciate this for complex cases, in my experience filtering is usually just a simple expression. It would be nice to also have a way to do this reasonably fast without having to write a custom C file.   Is the 10x-20x overhead just the python interpreter, or is it related to perf? Maybe we could have some kind of python fast path just for filters? Or maybe the alternative would be to have a frontend in perf that can automatically generate/compile such a C filter based on a simple expression, but I'm not sure if that would be much simpler. -Andi