Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp632947pxv; Thu, 22 Jul 2021 08:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVQUsjROosBbZVv0QLbptMSZYoJCE0CariG8f+EOIfXittF721PuBsZzX9D2RmUOri4wHp X-Received: by 2002:a17:907:7d9f:: with SMTP id oz31mr485033ejc.366.1626968220574; Thu, 22 Jul 2021 08:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626968220; cv=none; d=google.com; s=arc-20160816; b=rMlmmScYkBcgvPhtQ3xZZclWsBs5odpqIR9XubwNXLRogyQaYhHUf7sbnU2GQCaN6H pjmudxn1uQlv4HMuwA8Q5UnZzkfYUrS2XRcQ3FGeIPsABjgbw66jXJ5lg5LHekaFZ/0j KxjzRgdOWQcSaw8KwNlaCHVGNSTQoGwLPsPRb5SXA4OkHTOg6fNyZgDeLZGnmnUiyrL6 65zNWCJLBhyouFUzoX8J9PkJmTHamwkIeZepL6FuqaI2WMW80R/BJpLmXMFW/mXduEim mojgHTuWqkNu+qw6OByNWhcgce/RE80JN5flyL5I8LRDBrJ1uesq1OclCzwdKGF/gppw hNdA== 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=M49ul0bkJBQFuWjJm4FuBm3fFgxnr1HIV0sqLLOvDXs=; b=FIfq008nbDavRsJr43ms3Awn9EKMvsr8SyUZEb1Ob+7xprSLLv/P9ZZoVEEWUbtlqg yey1br9WJ5N171KkZYwyYXu0pUxZ0ba+8XO+EwMTyMht4twZegfPcANQAAFqgyV6CZbq 0Qq7vFCvER1o1NaTZ+mUQBIAvU475cUR0BWAPLI7FOTNix14oGq1f6ZuSMOYagpGgxx1 gt7AcZAPC0Y6YhVcdbSXYIcJem9aojBj4HsKdHVra5F5D5sjh4b0SbChLhbIqEeFqjee G7M0WSgzi2KT0rDrHX+7Zj9J9gyrcwQurwuJY7NHvEfM+FetIJ3r2xMm/O4qNI3MhLzh r+PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=armzozJM; 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 y15si4578574edc.243.2021.07.22.08.36.37; Thu, 22 Jul 2021 08:37:00 -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=armzozJM; 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 S232697AbhGVOxx (ORCPT + 99 others); Thu, 22 Jul 2021 10:53:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232644AbhGVOxu (ORCPT ); Thu, 22 Jul 2021 10:53:50 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90EECC061757; Thu, 22 Jul 2021 08:34:24 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id r11so6381037wro.9; Thu, 22 Jul 2021 08:34:24 -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=M49ul0bkJBQFuWjJm4FuBm3fFgxnr1HIV0sqLLOvDXs=; b=armzozJMAlKNiuq9bWfR6WGUdd8xa0OHH5L5fy0Ia6FcdEC03WhPLs3BfOdh2WwmSj sKKoefIXGpgTdb20h8CIZ5eBCual812a9RyuaKvjC8TiZl4fHl65Yd6YOfk159xQfuud mfXZohGq/H9TlSrjOUuRhz60lR8DH/bc3cHoBzZyMHqsnj8FrSDp73xVhgYxNUICWfxg T7Tb9yrBwxEOAoq0rPK8orHzbLi7Ev65qBY8p0T7Zsp+exx15+iQaQc8FcG+Ta6l6jaI ilhi+3hVOqbV3O/+FX3PtQAifol5x77zKvjnIs9X1JoPO/P/lZlj2rqYqi3Db5X2X8on g93g== 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=M49ul0bkJBQFuWjJm4FuBm3fFgxnr1HIV0sqLLOvDXs=; b=F7NjLRw5TGWcG29yT9up+iCvHfmsjJUVAPOx0DzQCGZmBuF92RLW4AEgL0ic4y+Ye+ uZJzEw1RWyrlbGVofwQBxoRrc/DBoF2FjoP8u0CTBwPSaX3nAonFJLK/HJMV6rY5OCV/ GsCDbLjAWxRY90HeXWCRGrVwYa5ek0/7np1XrlCc0iGX/MG0IK6fohPfMzKxU78hJdHv HQrtdImxTfGiFTdaATdvA9jaOouW7d1vxlysjwujnAJvA7XH+wTN9BDkLjATZbR8Pd9r fVjrxuY64UoFXEVJRjlX8ngY6rZ8kT8ED9YNE/v8wGNscq7Sm2mi7Tc+uZWhKXq6AzA6 YH8Q== X-Gm-Message-State: AOAM530Zc7mPIBk4XL37FRditg64Fnf97UPZybNB55inFcYPWSiAehJo COKCSc0Nr4Rf0ow5bCQpavc= X-Received: by 2002:adf:db85:: with SMTP id u5mr547432wri.167.1626968063144; Thu, 22 Jul 2021 08:34:23 -0700 (PDT) Received: from honeypot.. ([185.91.190.155]) by smtp.googlemail.com with ESMTPSA id o29sm23735557wms.13.2021.07.22.08.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 08:34:22 -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 3/3] perf test: mmap-thread-lookup: use gettid Date: Thu, 22 Jul 2021 17:34:16 +0200 Message-Id: <0328557450dc7817cd979ee71b33ca9166a1d78b.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 replaces the manual syscall to get the current thread tid, with the libc equivalent gettid. Since it is only available from glibc 2.30, the libc_compat.h header is included, which provides its definition in case gettid is not available. Signed-off-by: Riccardo Mancini --- tools/perf/tests/mmap-thread-lookup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c index 8d9d4cbff76d17d5..055cc850a6061798 100644 --- a/tools/perf/tests/mmap-thread-lookup.c +++ b/tools/perf/tests/mmap-thread-lookup.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include -#include +#include // gettid #include #include #include @@ -45,7 +45,7 @@ static int thread_init(struct thread_data *td) } td->map = map; - td->tid = syscall(SYS_gettid); + td->tid = gettid(); pr_debug("tid = %d, map = %p\n", td->tid, map); return 0; -- 2.31.1