Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3092813pxt; Mon, 9 Aug 2021 16:55:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8mS9+DVfLoZCu4/ykkQZAXS+cfyPvHrsZny0/MfAzema2UUUyWI2bfouX52CSJnSTBQCq X-Received: by 2002:a05:6402:1591:: with SMTP id c17mr1168888edv.15.1628553355344; Mon, 09 Aug 2021 16:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628553355; cv=none; d=google.com; s=arc-20160816; b=pstnMdtAm87A/WuiKO/NmcwKC+8eXHnNLK9aUkmWC0mgqdvYfBy7J065mgXi+Unel3 t+PuIgntcWMHVHo1KDeO36zP6HsLfkP02EBS3fT7/57aX/VJYZhPvnVLD51UEyE4McI2 QOrmV5ld5pHiDvnnfGdBcaKCbJTDER9UmmoPx31dwIzjrYYCeGJk12LK2ACovodmHdFm XSeRpVnHV0I0t0EWWFJMBKDRx0suJDUXk1qOc4Ehj4zQze7cEaw6yT6OX5aXgHZUiX7Z MpZAit26NYU2PN0J+zJvHw5rjWG/nP/X+l7pU7Uj2iKifNL6mbPtkf5Dqg6F7VhSfWEh WqBg== 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=X1+46iE6vZP5PXr6WhyXEk0R6qLsAgM/mZCWJ999TyI=; b=hsjkKuEw+riE8ZNaMBBuSOxCsxP6zamT7TiOTV7BJ5i8akzd0Td1g4lcHcanNcpI/s qqu0LL9spusE+P+5qNvkw2VRh4SQr47V+8ZLD4kTKz2+ULE9WSD0PLjM7HvFdOFc5+F7 nbQHQTET7P2c8WA8xsBYKTjXm881NQ1geJV6MnMaFV9mWdE7DMOKUXNRrm7MWTiQpmrB cXA+1E+AojyefvqffcoIoJrf2+q6dWxl+fqy8jUMf013ap3HU7wtVFRRKmdVbw4ugDK7 B1HyNNwXf+RDmoeU/rmcAcczvWUSUK7ypiHlT6lKiuQev+7W35vi1vQXW4g14Y/VZTHm 0Ysg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nqM3Dxu0; 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 e15si18020323ejx.19.2021.08.09.16.55.31; Mon, 09 Aug 2021 16:55:55 -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=nqM3Dxu0; 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 S234156AbhHIU2k (ORCPT + 99 others); Mon, 9 Aug 2021 16:28:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:38014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233500AbhHIU2g (ORCPT ); Mon, 9 Aug 2021 16:28:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 26DB36101E; Mon, 9 Aug 2021 20:28:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628540895; bh=GZtBG4eVbD+pfnOgxDdLXHWQqpxXh98WNaGc/VD+0es=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nqM3Dxu0VqOYHIQgS5X7WK06Bz8MJ9XQvR2hdi81N+wwzBy7sD5CNmv7GaNEB7yPG 2lYOFtBtydzP/hbZHdOkmhlX8fhyz+L1JAhX7yI2GwARmtUyLzkPQdVVhdXdElgMdp KS8LyqEA85Z9ImwSrZQQbNehvCmbf5msAoDIEeBIh1le92TGUCHAxrmR2vQvACvE8X 35uKLdg1/IoNPJk9AXODVtfBcjD2Ks/lqmKGC42giD+t9pAIhx41Shgxuntv3MXV4r CBVHMxJYT+63qizkXsfcsdleFOy1XeygSOF2vFgM+XKbaNMJdkbtUz1CJVuVL1TpWu AmGG/b1V9RilQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 45CD2403F2; Mon, 9 Aug 2021 17:28:12 -0300 (-03) Date: Mon, 9 Aug 2021 17:28:12 -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: [PATCH] perf bench: add benchmark for evlist open/close operations Message-ID: References: <20210809201101.277594-1-rickyman7@gmail.com> 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 Mon, Aug 09, 2021 at 05:23:31PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Mon, Aug 09, 2021 at 10:11:02PM +0200, Riccardo Mancini escreveu: > > +static struct evlist *bench__create_evlist(char *evstr) > > +{ > > + struct evlist *evlist; > > + struct parse_events_error err; > > + int ret; > > + evlist = evlist__new(); > > + if (!evlist) { > > + pr_err("Not enough memory to create evlist\n"); > > + return NULL; > > + } > > + bzero(&err, sizeof(err)); > man bzero > > The bzero() function is deprecated (marked as LEGACY in POSIX.1-2001); use memset(3) in new programs. POSIX.1-2008 removes the specification of bzero(). The bzero() function first appeared in 4.3BSD. > I'm replacing it with a memset(). This one is also equivalent: tools/perf/tests/pmu-events.c: struct parse_events_error error = { .idx = 0, }; https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html That text is a bit roundabout, as it says that the members that are not explicitely initialized will be initialized as variables with static storage duration, i.e. zeroed. - Arnaldo