Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2417863lqo; Mon, 20 May 2024 05:32:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWcAO8hLjP449x3axfgkFahnFHKGclUhxTBbrJsFEJiOo9hX0cS2ZsBPTvtlaZ7/RmsInMGhT93lY0h0ziGGgBOoAu+CRaaUILqkZ3qnQ== X-Google-Smtp-Source: AGHT+IG9ChrxN1yuDmhS6XtWvVBsp24KESvBwnnlhyYnm9nhiImgcihFL6JXwTivnFaZs1N2nvUb X-Received: by 2002:a17:907:91c7:b0:a5a:3a6c:8b56 with SMTP id a640c23a62f3a-a5a3a6c8ff6mr1588845566b.11.1716208326200; Mon, 20 May 2024 05:32:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716208326; cv=pass; d=google.com; s=arc-20160816; b=y5SuBPL2NGe6e+GQMOlUZAEWdAkmtmhKs5zBlyOmnXsziRL7I/+lUMtADQryzzFfoC JiFDVb8/ajrgQOoI9yLR9WK93nEqdFNdvTTQAGfZ1n6gNZ5uiCnsBPZrHcGCVRMb3JPW zwVi0aazxaj2GR7GEJgx148lVPAX3/rsdSBHWvdb3oIZxCXp/EzmgEthtQNxWv9eCUoV s08ya9W9vlqFzUd7hA24F2r8eswV1DAfdEp4E52zHc74lvcBPHkpfOfe2BufUL69yn26 7qimrE/biQspTgykUNn49vOJgHw9yg4l+pfm8uldLzxhxIPWP8YD2JzTNFxea/tbjGsb CWag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dRuofxLhF3f8UL1U7qALuckVdhTs6AkK5Sl8o4kqBr4=; fh=3qdKZaZnWy2Zq4/Kg/IJyvunFN5PAGmH2zs2MHj5FgQ=; b=dr0aYlNEmWIBFoMf8dxzuToUpsMzFY21+qkzex6wZfwzDVv8Rqb5WBvFvaCcgig1Tm mBXZR0sZtdhl4jdkAPBjfwW5UrLbMkVYHUuqKjrBxwY+msK6BxyfNvUEIRTwNdR8Fy8U drRmlsqvTxwFzR9RTihNDc1q4/yYgIOPNeK2hGaYS7ScXslPuOsWBVD3kdVwcW0jgVV6 R76fD3ZhVJ2Ftqw9c45O/svR//mCl9IuNNUz5J1zsLtD7kuv/tCJSpfM2M6vrvoX/9lk dCGWIUmULKpOxte1x0RHQ5/65SKF6fw/yOMqKcgZQk+oOCoi3QLK4z2yyYUkotabd2bf kDuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="S/q2OSFX"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-183734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183734-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5cd6210d7dsi606288866b.710.2024.05.20.05.32.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 05:32:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="S/q2OSFX"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-183734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183734-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id EC9511F23183 for ; Mon, 20 May 2024 12:32:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1068D55E74; Mon, 20 May 2024 12:31:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="S/q2OSFX" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8EB26A8AC; Mon, 20 May 2024 12:31:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716208279; cv=none; b=jRPj6YFCUnEjDgD/LWNxz9eaxnhxeuGX6ZNkkMYEEFCgG6XXfSDGKtw0AkB7UhJrjEooasAulf/rLE8xYj0STFJgeoDKI+CZkHoTZJ/Cm1SgJktXrY+9ygsnk+aJiQs+MBrOgzenmghJHpQhOtNLuM35ITJ5NevmdWQgCg2YElk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716208279; c=relaxed/simple; bh=OXLRHfwzhWhfF/o+k3sFxvU1ArXQmPhsk8nX+CqNWLg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=AHDiPLMcqCgD+W2xnN0DNsFWGUUU7e9ldOU4/ZtNjRlS/LgjPCBOfr9GU1T7OBlLNPh53tgeS1Zik58ocsArWgC8nMFN+O/JgL4hwJTsuHFePoaMS1osJzzEUgz7Mfq5XhtpgnCy2EI9XiLF+4ySSDvC9BfY3XM9yKxn9XmwI94= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=S/q2OSFX; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716208278; x=1747744278; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OXLRHfwzhWhfF/o+k3sFxvU1ArXQmPhsk8nX+CqNWLg=; b=S/q2OSFXstuVD0qwM6X0Bkysj75wxm07HxIz3bywBmHnf2HDI5U5V+h2 e6wQWuq5ftSqyJtstq20SxWk4PKJ8XWhUdJGXR/npQU3qmclTz5K9dFZE PbEzS2aeFobr1maJ06Yu+RedKz4GKTbjrpBaeHYlkKUu8e6ppIAPvHglq mTpGpYtae3NH7tSzx7IgeSQ870vtHzveWNIwqWTVrqJT9Wlu2O+e1fHAC ToAGhwUPFLPI+kzT0qxMXbeGfng4yWHK9dwa0DLlQgTBWIclY2ZfP2MlE nOOQLMQ3KoKsEcd79lfHIWcOH8p1Ri86exh1DyIPK3Sr8zc4TTVSJIZpv g==; X-CSE-ConnectionGUID: A6hzIa+9Tte4w3SxhMie2w== X-CSE-MsgGUID: a5Z7Kz+6QhS7i/YTxAK2+w== X-IronPort-AV: E=McAfee;i="6600,9927,11078"; a="12180358" X-IronPort-AV: E=Sophos;i="6.08,175,1712646000"; d="scan'208";a="12180358" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2024 05:31:17 -0700 X-CSE-ConnectionGUID: lIpSSv3RSiihX+465unR8A== X-CSE-MsgGUID: SiU3s4YXRKKwcZlDUzJZzw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,175,1712646000"; d="scan'208";a="33091197" Received: from unknown (HELO localhost) ([10.245.247.114]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2024 05:31:14 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, Reinette Chatre , Shuah Khan , Babu Moger , =?UTF-8?q?Maciej=20Wiecz=C3=B3r-Retman?= Cc: linux-kernel@vger.kernel.org, Fenghua Yu , Shuah Khan , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH v4 05/16] selftests/resctrl: Use correct type for pids Date: Mon, 20 May 2024 15:30:09 +0300 Message-Id: <20240520123020.18938-6-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240520123020.18938-1-ilpo.jarvinen@linux.intel.com> References: <20240520123020.18938-1-ilpo.jarvinen@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A few functions receive PIDs through int arguments. PIDs variables should be of type pid_t, not int. Convert pid arguments from int to pid_t. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/cache.c | 6 +++--- tools/testing/selftests/resctrl/resctrl.h | 4 ++-- tools/testing/selftests/resctrl/resctrl_val.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/resctrl/cache.c b/tools/testing/selftests/resctrl/cache.c index 1b339d6bbff1..9b74fce80037 100644 --- a/tools/testing/selftests/resctrl/cache.c +++ b/tools/testing/selftests/resctrl/cache.c @@ -101,7 +101,7 @@ static int get_llc_occu_resctrl(unsigned long *llc_occupancy) * * Return: 0 on success, < 0 on error. */ -static int print_results_cache(const char *filename, int bm_pid, __u64 llc_value) +static int print_results_cache(const char *filename, pid_t bm_pid, __u64 llc_value) { FILE *fp; @@ -133,7 +133,7 @@ static int print_results_cache(const char *filename, int bm_pid, __u64 llc_value * Return: =0 on success. <0 on failure. */ int perf_event_measure(int pe_fd, struct perf_event_read *pe_read, - const char *filename, int bm_pid) + const char *filename, pid_t bm_pid) { int ret; @@ -161,7 +161,7 @@ int perf_event_measure(int pe_fd, struct perf_event_read *pe_read, * * Return: =0 on success. <0 on failure. */ -int measure_llc_resctrl(const char *filename, int bm_pid) +int measure_llc_resctrl(const char *filename, pid_t bm_pid) { unsigned long llc_occu_resc = 0; int ret; diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index 00d51fa7531c..e6f221236c79 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -174,8 +174,8 @@ void perf_event_initialize_read_format(struct perf_event_read *pe_read); int perf_open(struct perf_event_attr *pea, pid_t pid, int cpu_no); int perf_event_reset_enable(int pe_fd); int perf_event_measure(int pe_fd, struct perf_event_read *pe_read, - const char *filename, int bm_pid); -int measure_llc_resctrl(const char *filename, int bm_pid); + const char *filename, pid_t bm_pid); +int measure_llc_resctrl(const char *filename, pid_t bm_pid); void show_cache_info(int no_of_bits, __u64 avg_llc_val, size_t cache_span, bool lines); /* diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index 6ea8fd2c65cc..18bfdff78089 100644 --- a/tools/testing/selftests/resctrl/resctrl_val.c +++ b/tools/testing/selftests/resctrl/resctrl_val.c @@ -572,7 +572,7 @@ void signal_handler_unregister(void) * * Return: 0 on success, < 0 on error. */ -static int print_results_bw(char *filename, int bm_pid, float bw_imc, +static int print_results_bw(char *filename, pid_t bm_pid, float bw_imc, unsigned long bw_resc) { unsigned long diff = fabs(bw_imc - bw_resc); -- 2.39.2