Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1444069pxb; Wed, 20 Oct 2021 05:21:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2eLFzxZIzHZit4AaP62Mr3Ci6wLKbc9t9+iw2BzVOVhheQ4v/ONBi4KBywSbeSHwakQ6w X-Received: by 2002:a65:664f:: with SMTP id z15mr33401750pgv.252.1634732509441; Wed, 20 Oct 2021 05:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634732509; cv=none; d=google.com; s=arc-20160816; b=oG9fcNE7z3kzkpBfa8mGzi3GuRmJ7PiqkqMCeoHB/+fjWGNlVaswb5MSykpM1vvbFJ vWfnT1W737xVLTq2k87adhvHbcRpwFAmG/b3P1YZcpiDTeDSIHqwm327du4g58Z/byDr bXxcGR6aCCHizWeVK8tiNq7jGVPMlLE4YtjhjlNERpywQ2oR7u0dK7xkML84NCf1GcS1 KC/xPDEVQ3Erhk80hTtC5eZqHtQV6eMk8C5xi+RxP1Zhh5Ylmp8uTcTp3uHvArugwKw4 FMrnnYFpGdjmTfT62anW1LRm4nOzRHLIt56a5nCS4/wGGMtSbFH1ekNS9Dev5uQrSq16 Llng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7p6x4ndhUF9o+vT5JDjX3kZy/boxNOuzWqDxZizdvqQ=; b=aTmcrSlsS+GoC0C+ceMs8SVXhcCpQmhM2V7qiLs8d6AEYnJta4LE4J4z45GzL9zacS vGJH/a7MHeHdKAo8XPMbjFWj1hdWxYaxM9AF0dWUI5F2tooVHirT8SLrcdzs/21eA0AC S82Uua0KBMQ5LREZ4s0UOWzgUbsyTfb8iUnsF0fwf8T7lvOcvIme8LIlZzYGwJO1SiKH Yo+hdH7Gnu8AI4HwQ2dKrd5iyUSjZfPhmKRdK8abNLiZZfmaqklTcsqAgulinhHYzrAg i4AqpL7A5a8zqrdNzZo6GjAF8aBxs3UuKoqfx2+stVvK4BPxvKZv96hTG3FTUaUCH/lT +uaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BtOJO2PT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si2970911pgf.436.2021.10.20.05.21.35; Wed, 20 Oct 2021 05:21:49 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BtOJO2PT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbhJTMWl (ORCPT + 99 others); Wed, 20 Oct 2021 08:22:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50642 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbhJTMWk (ORCPT ); Wed, 20 Oct 2021 08:22:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634732426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7p6x4ndhUF9o+vT5JDjX3kZy/boxNOuzWqDxZizdvqQ=; b=BtOJO2PTsl6L7xVctmzw3xOxxKqbfuHKNzjmF+ic/AYrmOOH4XIIie8mBb6wy3VBj1+t3h hRbjQANoIUUXjZdyMduwdZLAVYSoD961p/2BwU8d/Se561WWqPkadJueEm4k6lrGnj7gk2 v7mpTfTrqZ0vzeepcnsDShLtpNfmB74= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-126-vFCpbkxdP0KvqHj9k8QIQg-1; Wed, 20 Oct 2021 08:20:25 -0400 X-MC-Unique: vFCpbkxdP0KvqHj9k8QIQg-1 Received: by mail-ed1-f69.google.com with SMTP id l22-20020aa7c316000000b003dbbced0731so20810383edq.6 for ; Wed, 20 Oct 2021 05:20:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=7p6x4ndhUF9o+vT5JDjX3kZy/boxNOuzWqDxZizdvqQ=; b=4WyAOdVWCdaut5DY/wHdvXZ5wMy/AEdzntb93K/Lvs9cKytzOyNurGlKav/x4+Hr4r 2h4PePjOtEHQVWoxD7usgKoE8V35ptrh1DnKGcOO5liGgds+INPstLeip6RRSsu2J2Io KIocNFcGdzHE5whRfntbthMRt2T+yl6vL36ZRIfJrH6xnGEoUus/JCsTiJkPPJt34Jo6 3gF41ikJMviVoWFMARXmlRaWfRGM7kldIGBQ6UdevHN56eO5NgowGyfjDW53Hrjurhws /9s0KBRVfaJdbERjCxI5p2wlNmVjDWDO6Z0wwDGENxkuGoxwaHX3KmD6gpIrvpYBsMHG cnOA== X-Gm-Message-State: AOAM530GmqLbVmnRHUxe/Lnl79XzH51a1bZ8tbaAUqRYl+/uN5wkfstI jUlBDYjdFV+7taQjyWMdLZ8n4DaBl+dUSlZX6e78THpNj8SKIe9A1V7MTYQXxcacopsIMvNz2nT UPeLCtdN7kdepnR15aJrdfsKc X-Received: by 2002:a17:906:354a:: with SMTP id s10mr48288541eja.475.1634732423842; Wed, 20 Oct 2021 05:20:23 -0700 (PDT) X-Received: by 2002:a17:906:354a:: with SMTP id s10mr48288519eja.475.1634732423699; Wed, 20 Oct 2021 05:20:23 -0700 (PDT) Received: from krava ([83.240.63.48]) by smtp.gmail.com with ESMTPSA id l23sm987340ejn.15.2021.10.20.05.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 05:20:23 -0700 (PDT) Date: Wed, 20 Oct 2021 14:20:21 +0200 From: Jiri Olsa To: "nakamura.shun@fujitsu.com" Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Rob Herring , "linux-kernel@vger.kernel.org" , "linux-perf-users@vger.kernel.org" Subject: Re: libperf: lack of interface Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 18, 2021 at 08:57:20AM +0000, nakamura.shun@fujitsu.com wrote: > Hi > > >?> On Wed, Sep 01, 2021 at 10:36:40AM -0300, Arnaldo Carvalho de Melo wrote: > >?> > Em Wed, Sep 01, 2021 at 09:45:10AM +0000, nakamura.shun@fujitsu.com escreveu: > >?> > > Hello. > >?> > > > >?> > > I'm trying to change rdpmc test in perf_event_tests[1] to use libperf, but libperf doesn't have enough interfaces. > >?> > > Does anyone plan to implement any of these libperf features? > >?> > > > >?> > > - Interfaces that can run ioctl (PERF_EVENT_IOC_RESET) from userland > >?> > > - Interfaces that can run fcntl (SIGIO) from userland > >?> > >?> hi, > >?> we could add perf_evsel__fd like below, would it help your usecase? > >?> > >?> if you described your usecases in more details we could > >?> see if we could add/move something to libperf for that > >?> > >?> as Arnaldo said below it could be already in tools/perf/util/*.c > >?> somewhere ;-) > >? > >?As Peter says, I understood that for rdpmc, no reset is needed. > >? > >?However, PAPI resets it explicitly, for example, at PAPI_reset. > >?In other, PAPI also has the ability to call PERF_EVENT_IOC_REFLESH on overflow to call a user-registered handler, using SIGIO. > >? > >?I think it is desirable to be able to achieve similar functionality. > > Does anyone have any comments? I'll try to add that functionality soon, I'll cc you on patch jirka