diff options
author | Benjamin Gray <bgray@linux.ibm.com> | 2023-02-03 01:39:44 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-02-09 13:56:45 +0100 |
commit | 121d340be9a17ed89d523c56203908c01e09a306 (patch) | |
tree | d8d205c7b70aa5a237a559d5e7a12508bb9e2ea9 /tools/testing/selftests/powerpc/include | |
parent | selftests/powerpc: Add generic read/write file util (diff) | |
download | linux-121d340be9a17ed89d523c56203908c01e09a306.tar.xz linux-121d340be9a17ed89d523c56203908c01e09a306.zip |
selftests/powerpc: Add read/write debugfs file, int
Debugfs files are not always integers, so make *_file return/write a
byte buffer, and *_int deal with int values specifically. This increases
consistency with the other file read/write helpers.
Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230203003947.38033-3-bgray@linux.ibm.com
Diffstat (limited to 'tools/testing/selftests/powerpc/include')
-rw-r--r-- | tools/testing/selftests/powerpc/include/utils.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/testing/selftests/powerpc/include/utils.h b/tools/testing/selftests/powerpc/include/utils.h index 70885e5814a8..de5e3790f397 100644 --- a/tools/testing/selftests/powerpc/include/utils.h +++ b/tools/testing/selftests/powerpc/include/utils.h @@ -35,8 +35,10 @@ int pick_online_cpu(void); int read_file(const char *path, char *buf, size_t count, size_t *len); int write_file(const char *path, const char *buf, size_t count); -int read_debugfs_file(char *debugfs_file, int *result); -int write_debugfs_file(char *debugfs_file, int result); +int read_debugfs_file(const char *debugfs_file, char *buf, size_t count); +int write_debugfs_file(const char *debugfs_file, const char *buf, size_t count); +int read_debugfs_int(const char *debugfs_file, int *result); +int write_debugfs_int(const char *debugfs_file, int result); int read_sysfs_file(char *debugfs_file, char *result, size_t result_size); int perf_event_open_counter(unsigned int type, unsigned long config, int group_fd); |