From patchwork Wed May 12 14:51:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 435684 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp5235400jao; Wed, 12 May 2021 15:06:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhb6WiJSy6lymB5dUZ3kG3Ee5MrnCZ+n8gDEI8780n3Pr8VpfNT5C2xiBwUHFMgFwJXBOM X-Received: by 2002:a05:6402:154d:: with SMTP id p13mr46995719edx.371.1620857184348; Wed, 12 May 2021 15:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620857184; cv=none; d=google.com; s=arc-20160816; b=wY/3I6mHhrmqlGMvjEHerDsPmFLqKyI6fa4aUkkWgcekc1yiyhO5tNEoXLU0fd17KI 4BVxEPlxAdD5aQH2eJvEnRCiUV0McoBQgIWLffcQkh9wJZOkwUEUJsDa3Pd8obK+XYGa Lk8b1dMJ8EEgUJhyClNVWF7oF467VOo9jFz9VPZAFPv2XS0LAWFWpSn7kFcqdp2Weyo/ gZ8bsrlVaAOZ2YZySm4bb5eHILKMRYEdItXMTzLIgI24FE2w14qi+5Olj2MMAwM5wAzq lNIyHOEM+ycj0pvmKkUqp9cXQWcmwsawXHhTzLtaUn+pfvHAaVzHJSov0ebcWTiE1L9Z oOXA== 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=HhF9SgueLV5JIT78B+of08MGEp03uYuYjfPYTOXdTEk=; b=b3LhNWaQu1UI8WiCPLh4SRJFrYDCB/9zrDmG6tVIr9q1Mx+WxgaIw6qWB2JLv+7zvK 8fK6HocA3Sb9m9/SJ1lHxbZqKC7YPaP3FjgbFHG/nbP4nJMhsOXm9FwnyRMYnil0o1Tw 2DHNfpPKDIxDZs7Kcxt7M29k/qGI/RTLVkjs2JbQN3qdvEK9JQCXriIlOmwLDFK2tOxJ /o2EiT1DAjV72vog054Hmayaxrs2fN68O4JmmXe58+QA9OFIuyNswVzySAnQ44TavGK2 61ecSXp35ujbECHJxsrO0uoGnL4d7Tip435IJrqD/KuFyhNfjLltYp/fmkuM8Cfy+B5z lujA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LqEenp8V; 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 u19si859013ejx.176.2021.05.12.15.06.24; Wed, 12 May 2021 15:06:24 -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=LqEenp8V; 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 S241684AbhELRI7 (ORCPT + 12 others); Wed, 12 May 2021 13:08:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:46100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244600AbhELQuz (ORCPT ); Wed, 12 May 2021 12:50:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 00D2F61C83; Wed, 12 May 2021 16:17:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620836223; bh=1QXuvrQkRA4rndC7Ct4di5DBciBZwwp0qRTOcbZfm5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LqEenp8VmwWLlEK0ZG/HU4k8xdLsW2gq6DazL4jKDrfNrm/5mRODTcxKizxTmtk/B KHa1ntYZreKYQ21lKM3WGkxKviItMeB+yYkl4b7fiVqQIQo0NUv7OP/xKj9pTbRPgq 7jwwNaDbWkYXGfzPY61N1sligVmgxfiTR/IXg6pE= 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.12 660/677] perf tools: Change fields type in perf_record_time_conv Date: Wed, 12 May 2021 16:51:46 +0200 Message-Id: <20210512144859.292084829@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144837.204217980@linuxfoundation.org> References: <20210512144837.204217980@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 d82054225fcc..48583e441d9b 100644 --- a/tools/lib/perf/include/perf/event.h +++ b/tools/lib/perf/include/perf/event.h @@ -346,8 +346,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 {