Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2436835pxb; Fri, 8 Oct 2021 07:48:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywFGld8IWy23VmCAzZeDdwzCF+Gcr9Q0BzEzK5Zcg9fjdWhgupE3MHzhHrFU0bOx80i2ip X-Received: by 2002:a17:906:32d9:: with SMTP id k25mr4848296ejk.290.1633704515447; Fri, 08 Oct 2021 07:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633704515; cv=none; d=google.com; s=arc-20160816; b=xUjeWqmWntR2sGXnYVJt51YFj2Vfl9N55cm1bLsNsL6QuYRQ2HEvJDVrdgVGgyH7J7 mLDEJOkybjRA9BdBaEthu/WUqjpcbll52J1vFhuZkSCMgGnCGprIKED3Vk57UVHQS9vo z+9sxu8pfE+CMwg4GA/nw2mCw6YdY0UzjBG39CdD9QxAJaKAv29a3sqciwp/Wc+ZSjRO rY2vVMr35qA5csNyzawZW/xZ8AJnmAVpkut1pHUuxZo1WzEG7blYEMJJJkncLIyQ8Kfb E54Lodwex62QHdqAyKtolIUygiUqZC9/GJ80S9yLZ+/DZ0lfpKmowkQa3YB+Fxh45yJF qcAA== 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=lbqfudYdZoL/JnQCjl6fN7HikLFg66G9xTfQ2o2GwQM=; b=KpSSPKhTmXegdplDKovxWVs1uB8fDhZdFfazGNoHURAfN1bV4tqZDNJ/Ujm8oRl/Zb SY6A1q6qBvGM4dCFd4jHFl8nl5tT81CxG/cQHsyAexWnN0wEoRYr9XgpKPdRPfNHlsGp vvHH+UUPl4+ps89RDbTkuObCGosLoWJBijwRyLVZmBEk8KBHKd/ru+TLnFRJfeTCNWp2 ZhGiDEMt61p7YEptkVrvt98BvNNHKBe2mKRwrUWbTQRZ2F7C85Lzh7/aDD7CLgm5CnMk 5JeMs0Qjwyy6YRvYises+RZFNx/Zs8DvekDgqIHeHNg4NdwGckfmq/vuzzIPkt9ylobn 62Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ddXSJriJ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr1si6708781ejc.424.2021.10.08.07.48.10; Fri, 08 Oct 2021 07:48: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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ddXSJriJ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242604AbhJHOsB (ORCPT + 99 others); Fri, 8 Oct 2021 10:48:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:49284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242503AbhJHOsA (ORCPT ); Fri, 8 Oct 2021 10:48:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3C35660F58; Fri, 8 Oct 2021 14:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633704365; bh=KLXzbMi+/trg1z5YXY89GWNJjA4g33FvXuFqv1Rd9bk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ddXSJriJsdR6ETVhPhObOHdH7hjFweaOhrXLCWJulakA0+WToKl7r7EerGzIVXVbI Vt6k9vmXfP9F+Ne8ylZ0s0JYDsNlfu4+M49FqmDSLdejtiku+PiT9MuVZM4EJwx8Fk 5rAc3nDFyMtBgmlh4py0I4Dyl3iEFeNv/I2j1yvDAkUB25oOJVnHUFXsIusCwpHpNm E/RvcXGueyiwVdp9RJsoxbMFPWcrBXEdVqX0qy3dWKAztgRjbe6NCdSG47MoL3XBl8 WizvTt0hs/0scUlhne580XwLweqETUe5D4ipVixYMGMsuAgraxEjjMzOqRWKIZ4fUO atOFPRRye4P1g== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 44465410A1; Fri, 8 Oct 2021 11:46:02 -0300 (-03) Date: Fri, 8 Oct 2021 11:46:02 -0300 From: Arnaldo Carvalho de Melo To: Riccardo Mancini Cc: Ian Rogers , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [RFC PATCH v1 36/37] perf test/evlist-open-close: use inline func to convert timeval to usec Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sat, Aug 21, 2021 at 11:19:42AM +0200, Riccardo Mancini escreveu: > This patch introduces a new inline function to convert a timeval to > usec. > This function will be used also in the next patch. Thanks, applied. - Arnaldo > Signed-off-by: Riccardo Mancini > --- > tools/perf/bench/evlist-open-close.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/bench/evlist-open-close.c b/tools/perf/bench/evlist-open-close.c > index c18aa85725281795..00d0aef564f80d44 100644 > --- a/tools/perf/bench/evlist-open-close.c > +++ b/tools/perf/bench/evlist-open-close.c > @@ -26,6 +26,11 @@ static int iterations = 100; > static int nr_events = 1; > static const char *event_string = "dummy"; > > +static inline u64 timeval2usec(struct timeval *tv) > +{ > + return tv->tv_sec * USEC_PER_SEC + tv->tv_usec; > +} > + > static struct record_opts opts = { > .sample_time = true, > .mmap_pages = UINT_MAX, > @@ -197,7 +202,7 @@ static int bench_evlist_open_close__run(char *evstr) > > gettimeofday(&end, NULL); > timersub(&end, &start, &diff); > - runtime_us = diff.tv_sec * USEC_PER_SEC + diff.tv_usec; > + runtime_us = timeval2usec(&diff); > update_stats(&time_stats, runtime_us); > > evlist__delete(evlist); > -- > 2.31.1 -- - Arnaldo