Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4631435pxj; Wed, 12 May 2021 09:38:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7G7vCO4UeQDZ4xox2D7mPlfwZt5SY6boBmZgbKlqnFMUVt90dtQTuR6HYTZogbioSXycJ X-Received: by 2002:a05:6402:1c0d:: with SMTP id ck13mr44708172edb.170.1620837488557; Wed, 12 May 2021 09:38:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837488; cv=none; d=google.com; s=arc-20160816; b=tTgi4o5pDm5BPWvBZmSodzgPhQbKPZfiYBKzAT6Lc4ME3JVcRILaoKNo02e0J2Catf 612jgDaODvfow/LrlcNBp5Mhm4aEv7S1Ul530VEtVlILEX9Zk5e2yztXeF8LAgGCiEsX gqJQ7T7L8j7hEXQJZQm7BxEPYZWNJik6pX5x0aTb7AF9FC6w9S++/3pojNe7F6xx9EfP DfKHv9S6jrBqEVcgqTJsUzUe5JFMkyhE0F5wrz+99gV6QTomw8mHwDrNbFiGaYP3FR7i TGCpzKAxT8yMSWQvjSWm2rD/49MJkfzf1+nEKTKWe2D17Sjc+OWhjfOPIvUJevRGvHHO RkHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CtfqHVgE9XvRkTLzcPjj1EsDoInB9/XzG8BI6/fCodo=; b=um4bjQIxsBtvwGm5Fc/oJ9/0g1ccl7tfhLbJi46mAJglgtjmrGu1Lmpxidf8E/Whxa BzQB1eY/K9xl8oxcoLZ75s4XM6PXBzwOre1wt1nhl2sDWMJCsPS5fV5qAv1Ipq1WUUK6 7AFgSp6rUtSGHLnTCDK99wk6+Rz5dhooMLnVT8Lol8SVR5hLxm92/rig1kEJ/8RhmRql wa6Rk2o/EqCPdFjnl795kfua0v0hkv0dgMbykkTqSilRyN2tSnUC/ixKaRkRr7comIho QmEG7H71s1+/q5lYIez4LacxT/imMVV46dxcBkcS/32H8uD/IWcL9VxqcuXz99OHwVhZ YQkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vONhtI31; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si325507ejp.651.2021.05.12.09.37.44; Wed, 12 May 2021 09:38:08 -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=@linuxfoundation.org header.s=korg header.b=vONhtI31; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236979AbhELQhz (ORCPT + 99 others); Wed, 12 May 2021 12:37:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:40102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236739AbhELPqB (ORCPT ); Wed, 12 May 2021 11:46:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E9F3B619AD; Wed, 12 May 2021 15:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620833011; bh=brDECwq0ads36K/hjlP+Sn6y3VTsqo9k6dOwc+CzcbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vONhtI317Qwvu9OVpT5UirCI16Oy3Sy+CgMXSwPNCyDC98ifveSCVk27cSeyBXNkX de9X183xsXjxFHTkloLa+3eTDOvNrewIahaEBd8lQro2Mwv3UHO4V6HP0avSCtMUiD +qRabXe0oPzXh9fhzCqBnFRD38gCcEsEaDPQqArY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Leo Yan , Alexander Shishkin , "Gustavo A. R. Silva" , Ingo Molnar , Jiri Olsa , Kan Liang , Mark Rutland , Namhyung Kim , Peter Zijlstra , Steve MacLean , Yonatan Goldschmidt , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.10 512/530] perf tools: Change fields type in perf_record_time_conv Date: Wed, 12 May 2021 16:50:22 +0200 Message-Id: <20210512144836.587096611@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leo Yan [ Upstream commit e1d380ea8b00db4bb14d1f513000d4b62aa9d3f0 ] C standard claims "An object declared as type _Bool is large enough to store the values 0 and 1", bool type size can be 1 byte or larger than 1 byte. Thus it's uncertian for bool type size with different compilers. This patch changes the bool type in structure perf_record_time_conv to __u8 type, and pads extra bytes for 8-byte alignment; this can give reliable structure size. Fixes: d110162cafc8 ("perf tsc: Support cap_user_time_short for event TIME_CONV") Suggested-by: Adrian Hunter Signed-off-by: Leo Yan Acked-by: Adrian Hunter Cc: Alexander Shishkin Cc: Gustavo A. R. Silva Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steve MacLean Cc: Yonatan Goldschmidt Link: https://lore.kernel.org/r/20210428120915.7123-2-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/lib/perf/include/perf/event.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/lib/perf/include/perf/event.h b/tools/lib/perf/include/perf/event.h index 988c539bedb6..baf64ea74e10 100644 --- a/tools/lib/perf/include/perf/event.h +++ b/tools/lib/perf/include/perf/event.h @@ -336,8 +336,9 @@ struct perf_record_time_conv { __u64 time_zero; __u64 time_cycles; __u64 time_mask; - bool cap_user_time_zero; - bool cap_user_time_short; + __u8 cap_user_time_zero; + __u8 cap_user_time_short; + __u8 reserved[6]; /* For alignment */ }; struct perf_record_header_feature { -- 2.30.2