Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp639329rwi; Fri, 14 Oct 2022 06:54:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4vqEI9QHqL8+TpRzTgXBkvD2U2Qy+yWNudFfKHH9SdkomVFN1u7320lEAfVz+FYEpix/Z4 X-Received: by 2002:a17:907:70a:b0:750:bf91:caa3 with SMTP id xb10-20020a170907070a00b00750bf91caa3mr3527277ejb.711.1665755691258; Fri, 14 Oct 2022 06:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665755691; cv=none; d=google.com; s=arc-20160816; b=dW1jhLk/R1VUqpxDJYK35FbsW5qwZP5Q9ooeY7aXqZu2/TmE/jFBWZ0gtFPMey0EJ2 9oWBIExFbTb8tP8+yaOgHq9QoNKy+kL+yOUqaoHXbx0NMagRkSZtWSbkYNzqWBxfRQui APPKZzFSccG36PfJYgwG3NzpotM8FAZ7wXteNpB03WVm8RSa5jRCLcVGQJDPauZpwz80 bjUvf6uSu3JLC/xosQyt6PiBV8MGKuqdTdGe9F6ftDRWOdk+tiuOoNeafgwjcTPSRVuf xtpuOtaEiVH4ToU/qelgRRiOJs8vq3V9AouAz2toCfJ6lvlEPSi6ojX2VhoiVcxqDhac uZTg== 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=AwVkCZWhaQRH9RLHoaSEaZsTEZXDcbkKGo+ur1YEX6M=; b=QF9nk1gV/xY7UI6gCb8k/C35nyQ0WNjGFEk/0uihlHvXMZbunfr9ixX7OUuE9rLhcM b7KPlWwMXaHt0N7I6WfUB4LZtJeTlVePlFj7c6MJlckYHu4hNHDIHsLMvHgY0dqvQbKD zvVCUH+5ilJfr8xDPaFd6rgWvmpUOBw3JV+eC0TW4yEsJ18gw71dNm+Cwy+4WbUstc2Q s/1PaO0BbNXKnF8lMsw2UJSsp3ghsP4ESy2fEr+5Sh8LTbvoQYIXoo774I3AtQgNZqvP x98Km+CSxa2ATL0uqv2lYZ7A9zHol2G2KqZKYX2vNMenl99y5Dn9kROYIApsHydCIafN MNlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sgzWrH0f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id tx7-20020a1709078e8700b00783b75ec298si2147395ejc.395.2022.10.14.06.54.25; Fri, 14 Oct 2022 06:54:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sgzWrH0f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229689AbiJNNoQ (ORCPT + 99 others); Fri, 14 Oct 2022 09:44:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiJNNoO (ORCPT ); Fri, 14 Oct 2022 09:44:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B1881CFC48; Fri, 14 Oct 2022 06:44:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 098E461B29; Fri, 14 Oct 2022 13:44:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29CB2C433D6; Fri, 14 Oct 2022 13:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665755049; bh=6a1/9gmhcWI09EU5dgUgzkIaJdUpLf7dykv/IBOnfZ8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sgzWrH0f5oaL5rc8lVyfETNm3gzMRqGQ/DJXspgiqPLqZAZCrwuV1k5QCAmMEWEvA RbcpOQGfxCNb75TMUz15QXPE8axAmTgR/mt4jZW3374/scjl35v3QYxyRrIzhb7Nh8 XSVHjVIONpjK7FytE3YwvwxPyoyTC+g/FH/bKftzKiKCuXNVbekQQZW+ezLDAMQ0EE XD5sv9aQ0yx7bqYwGLaTXp5o5iicr5H2m5ucJ8GeOIm5RN5I1uPdczPxk2cfm/5FDI ZBZilV5XxZmdKMPCN+GtIxQ9BMiHlGfD+Vl1rlfPKb2Z+6BkkfnwxW+v5GHHaOhinQ YEWFyY8Fy50Qg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 6CBF54062C; Fri, 14 Oct 2022 10:44:06 -0300 (-03) Date: Fri, 14 Oct 2022 10:44:06 -0300 From: Arnaldo Carvalho de Melo To: Vitaly Chikunov Cc: Jiri Olsa , Arnaldo Carvalho de Melo , Ian Rogers , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, ldv@altlinux.org, Peter Zijlstra , Ingo Molnar , Adrian Hunter , Namhyung Kim Subject: Re: [PATCH] libperf: Remove reference to non-uapi header Message-ID: References: <20221006162919.2231389-1-vt@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221006162919.2231389-1-vt@altlinux.org> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Oct 06, 2022 at 07:29:19PM +0300, Vitaly Chikunov escreveu: > Fix build with libperf: > > $ gcc ./tools/lib/perf/Documentation/examples/counting.c -lperf > In file included from ./tools/lib/perf/Documentation/examples/counting.c:8: > /usr/include/perf/event.h:9:10: fatal error: linux/compiler.h: No such file or directory > 9 | #include > | ^~~~~~~~~~~~~~~~~~ > compilation terminated. > > Fixes: b2f10cd4e805 ("perf cpumap: Fix alignment for masks in event encoding") > Cc: Ian Rogers > Signed-off-by: Vitaly Chikunov So I'm applying this one instead after re-reading the thread: From 49b4ee0b20274812198b1ee7840055740d7981a4 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 14 Oct 2022 10:39:21 -0300 Subject: [PATCH 1/1] libperf: Do not include non-UAPI linux/compiler.h header Its just for that __packed define, so use it expanded as __attribute__((packed)), like the other files in /usr/include do. This was problem was preventing building the libperf examples on ALT Linux and Fedora 35, fix it. Reported-by: Vitaly Chikunov Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Dmitry Levin Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/perf/include/perf/event.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/lib/perf/include/perf/event.h b/tools/lib/perf/include/perf/event.h index e282faf8fd75b6a8..ad47d7b31046c7c9 100644 --- a/tools/lib/perf/include/perf/event.h +++ b/tools/lib/perf/include/perf/event.h @@ -6,7 +6,6 @@ #include #include #include -#include #include /* pid_t */ #define event_contains(obj, mem) ((obj).header.size > offsetof(typeof(obj), mem)) @@ -207,7 +206,7 @@ struct perf_record_range_cpu_map { __u16 end_cpu; }; -struct __packed perf_record_cpu_map_data { +struct perf_record_cpu_map_data { __u16 type; union { /* Used when type == PERF_CPU_MAP__CPUS. */ @@ -219,7 +218,7 @@ struct __packed perf_record_cpu_map_data { /* Used when type == PERF_CPU_MAP__RANGE_CPUS. */ struct perf_record_range_cpu_map range_cpu_data; }; -}; +} __attribute__((packed)); #pragma GCC diagnostic pop -- 2.37.3