All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: linux-kselftest@vger.kernel.org,
	"Reinette Chatre" <reinette.chatre@intel.com>,
	"Shuah Khan" <shuah@kernel.org>,
	"Babu Moger" <babu.moger@amd.com>,
	"Maciej Wieczór-Retman" <maciej.wieczor-retman@intel.com>,
	"Fenghua Yu" <fenghua.yu@intel.com>,
	linux-kernel@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH 04/13] selftests/resctrl: Use correct type for pids
Date: Fri,  8 Mar 2024 15:22:46 +0200	[thread overview]
Message-ID: <20240308132255.14442-5-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20240308132255.14442-1-ilpo.jarvinen@linux.intel.com>

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 <ilpo.jarvinen@linux.intel.com>
---
 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 c52eaf46f24d..84d18d66dab2 100644
--- a/tools/testing/selftests/resctrl/resctrl.h
+++ b/tools/testing/selftests/resctrl/resctrl.h
@@ -171,8 +171,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 7981589f4db0..07fd57d8d125 100644
--- a/tools/testing/selftests/resctrl/resctrl_val.c
+++ b/tools/testing/selftests/resctrl/resctrl_val.c
@@ -545,7 +545,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


  parent reply	other threads:[~2024-03-08 13:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 13:22 [PATCH 00/13] selftests/resctrl: resctrl_val() related cleanups & improvements Ilpo Järvinen
2024-03-08 13:22 ` [PATCH 01/13] selftests/resctrl: Convert get_mem_bw_imc() fd close to for loop Ilpo Järvinen
2024-03-08 13:22 ` [PATCH 02/13] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only Ilpo Järvinen
2024-03-08 13:22 ` [PATCH 03/13] selftests/resctrl: Consolidate get_domain_id() into resctrl_val() Ilpo Järvinen
2024-03-08 13:22 ` Ilpo Järvinen [this message]
2024-03-08 13:22 ` [PATCH 05/13] selftests/resctrl: Cleanup bm_pid and ppid usage & limit scope Ilpo Järvinen
2024-03-08 13:22 ` [PATCH 06/13] selftests/resctrl: Rename measure_vals() to measure_mem_bw_vals() & document Ilpo Järvinen
2024-03-08 13:22 ` [PATCH 07/13] selftests/resctrl: Add ->measure() callback to resctrl_val_param Ilpo Järvinen
2024-03-08 13:22 ` [PATCH 08/13] selftests/resctrl: Add ->init() callback into resctrl_val_param Ilpo Järvinen
2024-03-08 13:22 ` [PATCH 09/13] selftests/resctrl: Simplify bandwidth report type handling Ilpo Järvinen
2024-03-08 13:22 ` [PATCH 10/13] selftests/resctrl: Make some strings passed to resctrlfs functions const Ilpo Järvinen
2024-03-08 13:22 ` [PATCH 11/13] selftests/resctrl: Convert ctrlgrp & mongrp to pointers Ilpo Järvinen
2024-03-08 13:22 ` [PATCH 12/13] selftests/resctrl: Remove mongrp from MBA test Ilpo Järvinen
2024-03-08 13:22 ` [PATCH 13/13] selftests/resctrl: Remove test name comparing from write_bm_pid_to_resctrl() Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240308132255.14442-5-ilpo.jarvinen@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=babu.moger@amd.com \
    --cc=fenghua.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=reinette.chatre@intel.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.