From patchwork Wed May 12 14:50:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 435583 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4977572jao; Wed, 12 May 2021 09:17:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBh9DnAsUkMJqtBspwPchkBp7Uijxh+1MY25wzgFtmdliV4GS+xZyqSUb/nc9iPyM9P9CW X-Received: by 2002:a02:7009:: with SMTP id f9mr33454801jac.46.1620836269391; Wed, 12 May 2021 09:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836269; cv=none; d=google.com; s=arc-20160816; b=MLB5AVkzEn9Nds8ZcrA8U3gCGBcZTAOzX61hlQV1LtTMuV/5VJ959XgfjNSYtKh/ig aw2zOzBbcbNqvcbU1oqoG5DdntT4RK6H7swlsNYw9eIT5TKPah48H4QEm4wUi6VA8VTu iPCP+HDTp8MeB3KSSaNjLokS89hwBQXpUH1IQwptAJajU123Y07m9xc2PP7W5OMkBTL8 2uOPXRgUZ+QnP1p/QFYv87a0siQ7VYBYkMPeDirbeewIf0Qp6jL7KW0ZM9v+agG1SjML u94D4/hCH7LG8ulYtrUCft4Sy6YLDW510AP8tZ0VcVsAazqZofWbAt9Zv0IFU/kSDcTl o7FA== 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=GCXgFGNZjAlveKKFX58P6ms3IjHMLPaoR6LyN2yj2fap3guaqKr24DvmG4KIKsyNa2 PNC7z4rA2jCY7HSIW6oxNTdDSNNwVJioJaqh/oCbnMbHrGAKC+p1rkK1hSWhloNQUY66 vRXbjUoYSbMQroImLpKydQRgYQ3L9n5om4ISjpYh5hGz2NgibW1OGcKXP6Mss10wFwsP kenSkTLXVi+TPEjc5uDCLLon5znWp9PHQACEScSbcaII+zpBM8Zlsf7K7Snax5nmqWwm Cie5x38vrdBqulloIaMlHqbjCp7mMLHU1Pt+MPWaO0uN1+r8nZKSr673w9mBftOylIWW qPOw== 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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 q8si330223ior.12.2021.05.12.09.17.49; Wed, 12 May 2021 09:17:49 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S233999AbhELPvO (ORCPT + 12 others); Wed, 12 May 2021 11:51:14 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.30.2 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 {