License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-block.git] / tools / perf / arch / s390 / util / machine.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
203d8a4a
SSG
2#include <unistd.h>
3#include <stdio.h>
4#include <string.h>
5#include "util.h"
6#include "machine.h"
7#include "api/fs/fs.h"
8
9int arch__fix_module_text_start(u64 *start, const char *name)
10{
11 char path[PATH_MAX];
12
13 snprintf(path, PATH_MAX, "module/%.*s/sections/.text",
14 (int)strlen(name) - 2, name + 1);
15
16 if (sysfs__read_ull(path, (unsigned long long *)start) < 0)
17 return -1;
18
19 return 0;
20}