Contributors: 13
Author |
Tokens |
Token Proportion |
Commits |
Commit Proportion |
Stéphane Eranian |
75 |
37.50% |
1 |
4.55% |
Kajol Jain |
46 |
23.00% |
2 |
9.09% |
Sukadev Bhattiprolu |
39 |
19.50% |
3 |
13.64% |
Peter Zijlstra |
12 |
6.00% |
2 |
9.09% |
Ian Rogers |
7 |
3.50% |
3 |
13.64% |
Arnaldo Carvalho de Melo |
5 |
2.50% |
4 |
18.18% |
Ingo Molnar |
3 |
1.50% |
1 |
4.55% |
Adrian Hunter |
3 |
1.50% |
1 |
4.55% |
Anju T |
3 |
1.50% |
1 |
4.55% |
Andi Kleen |
3 |
1.50% |
1 |
4.55% |
Frédéric Weisbecker |
2 |
1.00% |
1 |
4.55% |
Athira Rajeev |
1 |
0.50% |
1 |
4.55% |
Greg Kroah-Hartman |
1 |
0.50% |
1 |
4.55% |
Total |
200 |
|
22 |
|
// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <linux/stringify.h>
#include "header.h"
#include "utils_header.h"
#include "metricgroup.h"
#include <api/fs/fs.h>
int
get_cpuid(char *buffer, size_t sz)
{
unsigned long pvr;
int nb;
pvr = mfspr(SPRN_PVR);
nb = scnprintf(buffer, sz, "%lu,%lu$", PVR_VER(pvr), PVR_REV(pvr));
/* look for end marker to ensure the entire data fit */
if (strchr(buffer, '$')) {
buffer[nb-1] = '\0';
return 0;
}
return ENOBUFS;
}
char *
get_cpuid_str(struct perf_pmu *pmu __maybe_unused)
{
char *bufp;
if (asprintf(&bufp, "0x%.8lx", mfspr(SPRN_PVR)) < 0)
bufp = NULL;
return bufp;
}
int arch_get_runtimeparam(const struct pmu_metric *pm)
{
int count;
char path[PATH_MAX] = "/devices/hv_24x7/interface/";
strcat(path, pm->aggr_mode == PerChip ? "sockets" : "coresperchip");
return sysfs__read_int(path, &count) < 0 ? 1 : count;
}