Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp202333lfu; Wed, 30 Mar 2022 20:45:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz4E8LUawX+cgmHg99ICki9W7oHZp0PL3fNAD5kAbX5pkZKbWT0d1wnUcpacbk0BOziwUZ X-Received: by 2002:aa7:88c5:0:b0:4fb:821:4017 with SMTP id k5-20020aa788c5000000b004fb08214017mr3151380pff.22.1648698337975; Wed, 30 Mar 2022 20:45:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648698337; cv=none; d=google.com; s=arc-20160816; b=Q3H/sROZI172IkREkWjSYUUxe9ckFLC0lmYH1icn4NXZrmOBHaQy+CR7qJXDqz/TzG 0Ue7T6qTSSE6I0C+o94187SYYhS2UoVU0Q+uAWeIThY3W1Z/DPatjLWXpS09SQsAhuTk 2P34t0igpvmZfX0q+WRdFHIAureHyORxjcAa7AdUuY2Jr1z8r65ire8CYGQ1FVmoGGir mNvt13hC870qL4KhmaJV6dWFBBKAdv4ObNv/40ajpHmHNRdH1YJUVPhXq3JSzPOkD8o1 ih8o3KH6V5bhSSqjs8Y2vycBMFm14WYKiYOFATnxlteTHazrOz3JPpIQyHrjlss2dv4m whkQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=y7pqT7vD7H7ZH3vY2pYSiPbBFtiXOL05aDa1RXn365A=; b=I9+t0d1ROL4qWviCNeOBrhQZgzUaT2oIk8owX8tU63FCrmp69uE3DZJ+sfFxggaC77 8/HOW9cps77bCe/99aFGM81uxkeiOpCnK6u+6d86reJOeErL2Htgw2FA5u1RbT83IGJB gOji1iZYnG3kY+cYNdor86SwbACIEUhDPkFZCWUqK06YounyfydQC0KchVTgVrk67RV+ i8Alug71M2ms7rxa0TbXX/IBP3A7Sfcq0evXtIrLHw+Ov6fkcdutb913Y9NCwFarXXzj aFR0WSRX/GWxR3qZxWl7sG7J4BlUkaWezuVywngk6an1XYRPpwB4Vs6dtVSBcur9G4Ny vhUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KrRVct+m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j17-20020a056a00131100b004fb5d3f2495si16137536pfu.274.2022.03.30.20.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 20:45:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KrRVct+m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E76E115041E; Wed, 30 Mar 2022 20:03:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346348AbiC3Nv7 (ORCPT + 99 others); Wed, 30 Mar 2022 09:51:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346349AbiC3Nv4 (ORCPT ); Wed, 30 Mar 2022 09:51:56 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4D74FA216; Wed, 30 Mar 2022 06:50:09 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id h1so24521767edj.1; Wed, 30 Mar 2022 06:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=y7pqT7vD7H7ZH3vY2pYSiPbBFtiXOL05aDa1RXn365A=; b=KrRVct+mSEvyTGpWJVfpNVJdVSa3WSGFL3YyVNCYVF5iatrcoIFQCb7VkQMGH5n4oI k1IR1flTmDZrV2BqpX+ky1ywkQC64dxQXe+2K2CB0k1OhRtRCuKtgfRtB1qLCdeaBHnh Zo0HB3QbJOrMW/jLUF0A3+pTuqb0ZyXWjKl2pcVhizVuS5DJD60yB+i7ImnKTP+TP8r/ gXF9BMJ8isIV2/5s3E/yh+L2cH83qzgSU43FM9DRgZs3GEsZ+gr5RqQauWYtsLDomhJB 1PTGLmhgoaUwQSvFz5faBbpmVLPoOc99bz2i90XiJnbOY7xlz7yDaacPsBsD/m1UBaSO Knrg== 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:in-reply-to; bh=y7pqT7vD7H7ZH3vY2pYSiPbBFtiXOL05aDa1RXn365A=; b=oAVszhWy7kjpyi8FNIXpaaTaijpmH0hKfNup3niTK/cZIDVBbStPs7za3vT3Ro7i9L NqiDYjehRanEC/R01uxmAX11Rk6IkISk1x3nrPmqaabT/bni7ri8PEoXr2ruG5LKilVS zBlAXxQg3uTglL5xoqTTtusW2PIo4kDsrByBKYZnN4slkcr46wCxee9p/rNfJ6ZgioCY Sgh9YTGr+sjVr5S2N6rpilW/ngKBEaZ625lEW5P703+VLXud6uNu5+E/rLGd5gcL7AZk TUpAu4kb1wwLHQq37Kyu+OWLKcuZC76nPpfmpRn0/zOYxywDmYcr06mn1Md/9J54XTvV LYPA== X-Gm-Message-State: AOAM532C1J7PtwOkB3gzYQXW+F/oToXduk3KdlMTWn9I61K05vAqu+Fi Uc72BRYw+8GGCUpxYQxoAp0= X-Received: by 2002:a05:6402:3452:b0:418:f963:42a3 with SMTP id l18-20020a056402345200b00418f96342a3mr10909132edc.12.1648648208286; Wed, 30 Mar 2022 06:50:08 -0700 (PDT) Received: from krava ([193.85.244.190]) by smtp.gmail.com with ESMTPSA id i11-20020a50fd0b000000b0041936bc0f7esm10006802eds.52.2022.03.30.06.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 06:50:07 -0700 (PDT) Date: Wed, 30 Mar 2022 15:50:05 +0200 From: Jiri Olsa To: Shunsuke Nakamura Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [RFC PATCH v2 0/7] libperf: Add interface for overflow check of sampling events Message-ID: References: <20220325043829.224045-1-nakamura.shun@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220325043829.224045-1-nakamura.shun@fujitsu.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 25, 2022 at 01:38:22PM +0900, Shunsuke Nakamura wrote: > This patch series adds interface for overflow check of sampling events > to libperf. > > First patch fixes a typo in the error message that I noticed. > > Second patch move 'open_flags' from tools/perf to evsel::open_flags. > > Third patch adds a interface to perform IOC_REFRESH and IOC_PERIOD. > > Fourth patch introduce perf_{evsel, evlist}__open_opt() with extensible > structure opts. > > Fifth patch adds a interface to check overflowed events. > > Sixth and seventh patch adds tests. > > --- > Previous version at: > https://lore.kernel.org/linux-perf-users/20220225103114.144239-1-nakamura.shun@fujitsu.com/ > > Changes in v2: > - Delete perf_evsel__set_close_on_exec() function > - Introduce perf_{evsel, evlist}__open_opt() with extensible structure > opts > - Fix perf_evsel__set_signal() to a internal function > - Add bool type argument to perf_evsel__check_{fd, fd_cpu}() to indicate > overflow results looks good.. it got more clear to me, sending some comments > > > Shunsuke Nakamura (7): > libperf tests: Fix typo in the error message > libperf: Move 'open_flags' from tools/perf to evsel::open_flags > libperf: Add perf_evsel__{refresh, period}() functions > libperf: Introduce perf_{evsel, evlist}__open_opt with extensible > struct opts > libperf: Add perf_evsel__check_overflow() functions > libperf test: Add test_stat_overflow() > libperf test: Add test_stat_overflow_event() I'm getting: [root@krava perf]# make tests running static: - running tests/test-cpumap.c...OK - running tests/test-threadmap.c...OK - running tests/test-evlist.c...OK - running tests/test-evsel.c...FAILED tests/test-evsel.c:286 failed to overflow count FAILED tests/test-evsel.c:286 failed to overflow count FAILED (2) FAILED tests/main.c:13 test evsel make: *** [Makefile:162: tests] Error 255 thanks, jirka > > tools/lib/perf/Documentation/libperf.txt | 22 +++ > tools/lib/perf/evlist.c | 20 +++ > tools/lib/perf/evsel.c | 210 ++++++++++++++++++++++- > tools/lib/perf/include/internal/evsel.h | 2 + > tools/lib/perf/include/perf/evlist.h | 3 + > tools/lib/perf/include/perf/evsel.h | 35 ++++ > tools/lib/perf/internal.h | 44 +++++ > tools/lib/perf/libperf.map | 8 + > tools/lib/perf/tests/test-evlist.c | 135 ++++++++++++++- > tools/lib/perf/tests/test-evsel.c | 111 ++++++++++++ > tools/perf/util/evsel.c | 16 +- > tools/perf/util/evsel.h | 1 - > 12 files changed, 588 insertions(+), 19 deletions(-) > > -- > 2.25.1 >