From nobody Fri Nov 29 15:32:24 2024 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011063.outbound.protection.outlook.com [52.101.70.63]) (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 18E0019D09D; Thu, 19 Sep 2024 11:59:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726747174; cv=fail; b=YATdJou7lke1/BP66rU9LNuNmN8BpzpvFZe5UvLzHdejwiMLFYjKRR0BmbdqFhpUjDfKkgHSBh3VENUt6oT5ryGWMwYxpXQz2ODMdVIHXOABZc24Vd7ZdUH4qoRlYKpIMamKSQgoxTbgHLZKj+ObOzQF47Nx3bi+Vb4NObHskfg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726747174; c=relaxed/simple; bh=3VRxKJ9AMVkG43bNRts67mg0uY8nlScY7CMHWgVbMXA=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=uBtIqlk5nmnarRZL+9xdkin677H1Z7zVz+MAtQurgnXCKErGNVDEY16VX7D/CKcvym1/MhhYTOowUPomuma6MEG67y5vD51nPfo3381w37n3To+i/A/ZvJM/F5kdLD/fF8pW1mVg43jIQwSMK5DG5dtu9YgWbgVnwWhTXh3tXqA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=pM9g5HgT; arc=fail smtp.client-ip=52.101.70.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="pM9g5HgT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yum9+6JNBxBb5Nq0f3ZLTuCrSkYyutVViRuyPDHOisoUlppF0TEdy6VqGZgBBnBCK5pfeyen1n8ZZwoKB0cH63RtqkU/VZqCjOLini1GK+iHUe4vdmMxnaU/aEHNmINdYYN19KmzNJImPtVA4ndDCDDZuf+Ha1tyVqJ908zt7oaqgB0HPKgF4IpxUBVtWb51V2sA6zOmupCTjakoJVM4SzdU2TetKCtI/nW8SAu+yx8zSgN3XyjqC9JtgznuC6SChFWm/Ru0DrblGpfnyiGMtgoDhx8awGVt1TKxV8SjK5ysaF0OjXsFNTbW8LnaHR6d4ot27H2JoPVERR2gsPSzfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tBG1dMtRDe83S2s/baUmpREnYT11PE2POSs8F04B+2A=; b=tvVqGeG0gCTHbNLNH1gA4oVLMxqM/Fm7xjnWIumkbo2mWwJVWzIZhIGT1wz/9euMFVN6cc/R10KcwhZyDfqLhJH3ZA90h7YBv4lmfZn7u20MTHcxp3F6T9DxfSeXbOGD7VSPZfVF5AVqB3MlSV8rP1oKzOO4ONF2r8vPaQRUTX6UOFpKxpO5WGY+9H+wcpcIOj2hiZpem45tlGoIPFji0E5k31fq72hWx8TEWFdXQG2QQnFmbNBnUY2johj8LqVqM5gP9tJm5opcpw0HJ6uZJ8DoXAbDO/uFOG+/PMxgSMY4pxR2c85PKCUInR2TbrRhEH1FCfPX1ziNYWLx33VHYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tBG1dMtRDe83S2s/baUmpREnYT11PE2POSs8F04B+2A=; b=pM9g5HgTk1JN2cU9VidK0uCmuffUbm9O6OsWv+laQcozM4Np6lkScH0Pf7qCQJ9Ww8S8XxjdNJFlkMKwJR9AAlGyehp4cEmZOFhNEYf9GU8trtJknZ8/6VYC9F1uAjV1l6c8/HqDZN1985DNfkJY6tzS4/OBpLBpCUWgsqFyEimGhurh4ZE/qtVUiXsnYSglWdEbOKDWi5UGV0xQiYIKKegz5a87/ThJnMkUA4oD9ZThPiB/h3JGC8UMgjNuNnOvMjqxjKMLzM492uuxYXj9m468eNtvenqM/vj6vmsfJ2k+GaKORpLaD4NNtgO8B384OaQNzLC6KfRV7OVMoFAkHQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by DBBPR04MB8041.eurprd04.prod.outlook.com (2603:10a6:10:1e2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.21; Thu, 19 Sep 2024 11:59:29 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%6]) with mapi id 15.20.7982.018; Thu, 19 Sep 2024 11:59:29 +0000 From: "Peng Fan (OSS)" Date: Thu, 19 Sep 2024 20:08:11 +0800 Subject: [PATCH v2 1/2] pm: cpupower: bench: print config file path when open cpufreq-bench.conf fails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240919-pm-v2-1-0f25686556b5@nxp.com> References: <20240919-pm-v2-0-0f25686556b5@nxp.com> In-Reply-To: <20240919-pm-v2-0-0f25686556b5@nxp.com> To: Thomas Renninger , Shuah Khan , "John B. Wyatt IV" , John Kacur Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peng Fan X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1726747701; l=1089; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=2pxOMW3LybW9Th81wVWF0biaYjFBiO8zFnKPhpofG5A=; b=PIgXQ4U9bYymafhhVsi5sj9lSnPebIElhegRrkKDh79RrUg8YrY9jfCzgFqEOauX4IroZPrnE TUQWr7Pv6J6Aes823l/CIBUWxWoHIab9AvnO7iWjHLO4Wco8mRvvzVi X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI1PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:1f4::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|DBBPR04MB8041:EE_ X-MS-Office365-Filtering-Correlation-Id: 5edb2788-5a48-426a-4c08-08dcd8a28433 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?aDhXWjBTa0VtNWdQdk5SeXpFM3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lu?= =?utf-8?B?OHJJRklPVFNrUUpQbnNRMkNNd1ZtVHRQbElLQy9YYURSSFZQVGk1emdNNnFS?= =?utf-8?B?K2xLRVZCZDQ2WFZTdTQ2VVg4MFZlU3FZcVgwcTdpUFRTNkE9PQ==?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(52116014)(1800799024)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MXRZOS9UTlhJNEh5eHl1OW9VUExWTE5OQnpZM012ck5Ga1MzNkNrR29ySWNv?= =?utf-8?B?YVZObTNGMzBHaDhhRVdqYjN2L2l1MmdmZWZjeUtpaXlITXlEcWhVdkhEK0FF?= =?utf-8?B?ZE9zVjFHWHhPWnYzVDk1MmwrMENnbHhuS3V5N2k5ajREWUJKd09xcWxlN25E?= =?utf-8?B?bGJFMW9wVk9xcnFKN3ZkU1NsZmI5c1VuaEVTTU1tSkpJRS82ZnZNVzMrTytp?= =?utf-8?B?WmVkSVd4V2laaTNhaWJMZ1prWmVHZ0hXbytvUFZTbTE4bEpobldveXVJWC9I?= =?utf-8?B?NktBNTBiNHUrY0pna0VRcm01bFVnMU5LMG1wNDYrbkFsS3dkME1OTUVLNDRp?= =?utf-8?B?aHdCMEhoZjVFSmJsZ3BLcmlOQlAwRGtvVm5XdG5uY1crQi94dzhORGNkbXlh?= =?utf-8?B?Y3JsTVF2L2Fpai9INXl4QTFvTVRxeFpSUGlhaWhqaEhuN0NRMnhyQ05WcEkr?= =?utf-8?B?cU5tdlhNblJnUE5rdGM5UElQQUJFaUlveFY1aUdRSlZyQldKVlZIZkZzWkRu?= =?utf-8?B?SHJMZ3cwMmdzWDFKMmFzYThaVURldUlyM242RG5CdUVmMWxyMWZm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dGtsRG5idWhFNDRIbG14d29K?= =?utf-8?B?R09USytqRS9rd1ltOXc3TjhtSVU1QnF4NzFkNFlzN2xMZHQzUWVNRWVZb2kz?= =?utf-8?B?bGJiei9Dc1NIanhJeGkxWng4RE51c2EyRk5iWUUvOEZtUEhvSXA5NTFrYXNG?= =?utf-8?B?ekh2TEFoMGFpbk92cElxL3ZLSkJkbElVd0s0NVJua3A4S0g5OXUydmN3c1lP?= =?utf-8?B?UkVnZDRxSXhJRzExTEVUbDVCU01VdkJFdm1kY3VOWG5YWi9ibWxxRVBXRDdW?= =?utf-8?B?eFRrMjBYSTlEUWx3OFNmbUU2U1lsUjVSY3BKTVVrWGtaUGNybDdHamVCT3Zw?= =?utf-8?B?N2VSSmV3WUNYL0Y4bnVESmtsVGVzUHpEZ0tvN3EwMVlpLzZSVFZNMGtKT3BC?= =?utf-8?B?Y0FnMklZdVUzRXh3RXdhcGRKM3lzelFuSUpDUzhrZzFmZnFTZXY3NDFUbjRa?= =?utf-8?B?QWRSUzdZSi9tdHJHTzVRdlcybzl4NkgxQlZ6RXg0dThtTHpvNlNyNm1FemQ1?= =?utf-8?B?RzJBOTRvWXVWdFBYbmxkTHFDMEtIT0YwNlYxOGszUGEzdTFtSTNQeURIMm85?= =?utf-8?B?VG5qZkIxSllRY1hIdXVOSzd1U0J4SEk1KzY0QS9qd1g4dlovZWtEa3hISkx5?= =?utf-8?Q?W4DEqWy6YO1tK+V9F5UI4t1Xx?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5edb2788-5a48-426a-4c08-08dcd8a28433 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 11:59:29.5526 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fvVd+1P0g2d60TgweuP24oUvSqrg+0MH/cUC4soymrWujwwzLdENe0SDiVnWFAuw4vzhgeSDxq4HdYILG3zF/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8041 From: Peng Fan Print out the config file path when fopen failed. It will be easy for users to know where to create the file. Since we are here, use strerror to drop the usage of perror. Signed-off-by: Peng Fan --- tools/power/cpupower/bench/parse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/power/cpupower/bench/parse.c b/tools/power/cpupower/benc= h/parse.c index e63dc11fa3a5..080678d9d74e 100644 --- a/tools/power/cpupower/bench/parse.c +++ b/tools/power/cpupower/bench/parse.c @@ -4,6 +4,7 @@ * Copyright (C) 2008 Christian Kornacker */ =20 +#include #include #include #include @@ -165,8 +166,8 @@ int prepare_config(const char *path, struct config *con= fig) =20 configfile =3D fopen(path, "r"); if (configfile =3D=3D NULL) { - perror("fopen"); - fprintf(stderr, "error: unable to read configfile\n"); + fprintf(stderr, "error: unable to read configfile: %s, %s\n", + path, strerror(errno)); free(config); return 1; } --=20 2.37.1