Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp632482pxv; Thu, 22 Jul 2021 08:36:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC59KHKCmLNlOvVoDXlA67+A8d6R0NAgpzZ4jZX1BEJ+cCaz4C56v1kzqgj4kfIG54++Xt X-Received: by 2002:a17:906:5d0b:: with SMTP id g11mr452362ejt.437.1626968183714; Thu, 22 Jul 2021 08:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626968183; cv=none; d=google.com; s=arc-20160816; b=FiD5wuAo6DVL2235KMAxxmT/785F5M/a91ymlxTZHC4yswMi09aZePgWxlV4FG03eo yn7kHOAyzFhOFbG+81LlcjuA9vkXifx8Fr6QBFNqfK7ULOVOYww9mNBsyTfVuSM3mq16 Ovuik2sNNe47GgVOuEejesp2FO4fJXVtsCzkjN1ppK6z6nu06G+Ht2f9tWfhme72U0W5 qs5KOXXO7gURGstw9Bi718CgtRLF2drnh7DyeCz05AeYUVdIkksla9/Q5Cd2BEUq5C/R PQMI6N7ERD0nXRGCHMR169/ZwTSoXesHvR/Q2rafm0xzK7ZG4EXHPyUN3dXMtsA9K+lj 0uWg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Xa7FzpBYUXmISMnIJxzW5ASV3zaOJFb+/T9sK/Wyh4s=; b=KBXnb4C/vFS8ikL0hZ9nps1HeISp/T6yXslgRgJuXz3jwQ50Xgl4qefETk5HrGhdzN MEkSV4k5/aeG8eQwnZDgrOepE22GySk3XUPbQ3LppAw6lKHK6df5BJPFrTGZ7rDn3Xo/ JUNczBh1tA+ltPUaDsnam8/r0WwJ0TIEOCtbgvs5uqNaa/qfzeZ1UfgRw4RO0rp0rKkD jpyqlff0hCriYq2uOkwj25kQUOIcKpm42jlttMiGDR2++rgxE9k9ghYRef4dAimnPYMf zK1f5RvbTBKxXXdlGb9io7HljrUKdQ4OEYkIgKt1/CIS7scPDKb7iwgRz2vQYq9HSKv+ KE8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Bq8DlR8z; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j5si30726262ejs.749.2021.07.22.08.35.59; Thu, 22 Jul 2021 08:36:23 -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=@gmail.com header.s=20161025 header.b=Bq8DlR8z; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232654AbhGVOxt (ORCPT + 99 others); Thu, 22 Jul 2021 10:53:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232644AbhGVOxr (ORCPT ); Thu, 22 Jul 2021 10:53:47 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A287C061575; Thu, 22 Jul 2021 08:34:21 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id p15-20020a05600c358fb0290245467f26a4so3226721wmq.0; Thu, 22 Jul 2021 08:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Xa7FzpBYUXmISMnIJxzW5ASV3zaOJFb+/T9sK/Wyh4s=; b=Bq8DlR8zBiP/nDa3QgvCWT6WN06iZ4Cy3cKi7abkdKshiVIWDsRmCP+HO2jhn350QT KimuTjdOoFqwai+veHIjJBQOymFbl+mbsl63vbodmusDgATZD/EhbzbzQ+S0Jpf7Y0gW pgQ7xUQRrGe8ZQG8NeqC7xeieJWWxDLqjXH8rUTrv0Y7/klsYL0F+d9b7QjRFz7l9HOf x6sfXaw0m4I9WRKY+jmLGEn7r3YOlI+WD84KTs6n8a+CUjrTF2qj3BV3qQ1ueap5KXyA VtIWYQ8KTZf2ZwXbhTfQv4WPdqXYf4qW11zHq/wckSJwoG0dC50lrqx3iM8PTcO2gXuq NtIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Xa7FzpBYUXmISMnIJxzW5ASV3zaOJFb+/T9sK/Wyh4s=; b=bIvcqnlldkqILk3S8EHEnW8lMeSHd3RAecBXYZi6DavL00LJ/YP8B3t/yC+EsP75Uu keumrsb7lpW+oIpPNOsS89auypFdAEEY7QDsCPAGzkje8nNRQH41CE0RkqSmd0479ZsP XI6NF+udE3Y0Q8CH3G5pMEQSHKPav+kEy4diAb/AS5J+XUVoUTVKXiZb7noWB6qy7T/o zSjG7ynohT7k4NSIS/TyJWqQ4j/Ej71RBI6KzYHtfSqjVEkglIHgZ7jFr2A0NUUipkSz qswGWLkwLVc4X6rNMcOpI3Ur2B2dNeSNy3+NdvIzaEXAZf6wFYxFD3Rl9U7yHThPf1RO Khjg== X-Gm-Message-State: AOAM5312ZUMR28WU4dbw/S/4p2csiEgC16Hm+e5iYYIpLDqWnbZSRvH9 1gW9jYgh1yfhjqvaeENRDK8= X-Received: by 2002:a05:600c:4c11:: with SMTP id d17mr9824591wmp.121.1626968060143; Thu, 22 Jul 2021 08:34:20 -0700 (PDT) Received: from honeypot.. ([185.91.190.155]) by smtp.googlemail.com with ESMTPSA id o29sm23735557wms.13.2021.07.22.08.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 08:34:19 -0700 (PDT) From: Riccardo Mancini To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Riccardo Mancini , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH 1/3] tools libc_compat: add gettid Date: Thu, 22 Jul 2021 17:34:14 +0200 Message-Id: <309becd325626e04015ad7b5f6fc701e569f918d.1626966805.git.rickyman7@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds gettid to libc_compat.h, since it was added in glibc 2.30 and is not available in previous versions. The function is defined only if the HAVE_GETTID is not defined. Signed-off-by: Riccardo Mancini --- tools/include/tools/libc_compat.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/include/tools/libc_compat.h b/tools/include/tools/libc_compat.h index e907ba6f15e532b6..58762c9c49c22ef1 100644 --- a/tools/include/tools/libc_compat.h +++ b/tools/include/tools/libc_compat.h @@ -17,4 +17,11 @@ static inline void *reallocarray(void *ptr, size_t nmemb, size_t size) return realloc(ptr, bytes); } #endif + +#ifndef HAVE_GETTID +static inline pid_t gettid(void) +{ + return (pid_t)syscall(__NR_gettid); +} +#endif #endif -- 2.31.1