/* * (C) 2011 Thomas Renninger , Novell Inc. * * Licensed under the terms of the GNU GPL License version 2. */ #include #include #include #include #include #include #include "helpers/helpers.h" #include "helpers/sysfs.h" static struct option set_opts[] = { {"perf-bias", optional_argument, NULL, 'b'}, { }, }; static void print_wrong_arg_exit(void) { printf(_("invalid or unknown argument\n")); exit(EXIT_FAILURE); } int cmd_info(int argc, char **argv) { extern char *optarg; extern int optind, opterr, optopt; unsigned int cpu; union { struct { int perf_bias:1; }; int params; } params = {}; int ret = 0; setlocale(LC_ALL, ""); textdomain(PACKAGE); /* parameter parsing */ while ((ret = getopt_long(argc, argv, "b", set_opts, NULL)) != -1) { switch (ret) { case 'b': if (params.perf_bias) print_wrong_arg_exit(); params.perf_bias = 1; break; default: print_wrong_arg_exit(); } }; if (!params.params) params.params = 0x7; /* Default is: show output of CPU 0 only */ if (bitmask_isallclear(cpus_chosen)) bitmask_setbit(cpus_chosen, 0); /* Add more per cpu options here */ if (!params.perf_bias) return ret; if (params.perf_bias) { if (!run_as_root) { params.perf_bias = 0; printf(_("Intel's performance bias setting needs root privileges\n")); } else if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_PERF_BIAS)) { printf(_("System does not support Intel's performance" " bias setting\n")); params.perf_bias = 0; } } /* loop over CPUs */ for (cpu = bitmask_first(cpus_chosen); cpu <= bitmask_last(cpus_chosen); cpu++) { if (!bitmask_isbitset(cpus_chosen, cpu)) continue; printf(_("analyzing CPU %d:\n"), cpu); if (sysfs_is_cpu_online(cpu) != 1){ printf(_(" *is offline\n")); continue; } if (params.perf_bias) { ret = msr_intel_get_perf_bias(cpu); if (ret < 0) { fprintf(stderr, _("Could not read perf-bias value[%d]\n"), ret); exit(EXIT_FAILURE); } else printf(_("perf-bias: %d\n"), ret); } } return 0; } '>
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-16 09:34:37 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-16 09:34:37 -0800
commit2eabb8b8d68bc9c7779ba8b04bec8d4f8baed0bc (patch)
tree4d8ea8e6ca52f1938269937834641205d8d888f0 /sound/soc/zte/Makefile
parent49def1853334396f948dcb4cedb9347abb318df5 (diff)
parentce1ca7d2d140a1f4aaffd297ac487f246963dd2f (diff)
Merge tag 'nfsd-4.10-1' of git://linux-nfs.org/~bfields/linux
Pull nfsd fixes from Bruce Fields: "Miscellaneous nfsd bugfixes, one for a 4.10 regression, three for older bugs" * tag 'nfsd-4.10-1' of git://linux-nfs.org/~bfields/linux: svcrdma: avoid duplicate dma unmapping during error recovery sunrpc: don't call sleeping functions from the notifier block callbacks svcrpc: don't leak contexts on PROC_DESTROY nfsd: fix supported attributes for acl & labels
Diffstat (limited to 'sound/soc/zte/Makefile')