plateform
stringclasses
1 value
repo_name
stringclasses
2 values
name
stringlengths
1
78
ext
stringclasses
2 values
path
stringlengths
15
1.11k
size
int64
1
8.55M
source_encoding
stringclasses
11 values
md5
stringlengths
32
32
text
stringlengths
0
8.49M
google
android
bitmask
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/utils/helpers/bitmask.c
7,467
utf_8
48efa64e3db18bae989f911da23168d9
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <helpers/bitmask.h> /* How many bits in an unsigned long */ #define bitsperlong (8 * sizeof(unsigned long)) /* howmany(a,b) : how many elements of size b needed to hold all of a */ #define howmany(x, y) (((x)+((y)-1))/(y)) /* How many longs in mask...
google
android
cpuid
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/utils/helpers/cpuid.c
4,504
utf_8
3583542ff07e6cd10747dcb833709c56
#include <stdio.h> #include <errno.h> #include <string.h> #include <unistd.h> #include <stdlib.h> #include "helpers/helpers.h" static const char *cpu_vendor_table[X86_VENDOR_MAX] = { "Unknown", "GenuineIntel", "AuthenticAMD", }; #if defined(__i386__) || defined(__x86_64__) /* from gcc */ #include <cpuid.h> /* * ...
google
android
cpuidle_sysfs
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
4,619
utf_8
a2a133668576aaa3574a280da11e7fbb
/* * */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include <limits.h> #include "helpers/sysfs.h" #include "helpers/helpers.h" #include "idle_monitor/cpupower-monitor.h" #define CPUIDLE_STATES_MAX 10 static cstate_t cpuidle_cstates[CPUIDLE_STATES_MAX]; struct cpuidle_monitor cpuidl...
google
android
amd_fam14h_idle
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
8,644
utf_8
c34bb27012731c379cd57bc4f84b4d91
/* */ #if defined(__i386__) || defined(__x86_64__) #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <time.h> #include <string.h> #include <pci/pci.h> #include "idle_monitor/cpupower-monitor.h" #include "helpers/helpers.h" #define PCI_NON_PC0_OFFSET 0xb0 #define PCI_PC1_OFFSET 0xb4 #define PCI_PC6_O...
google
android
snb_idle
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/utils/idle_monitor/snb_idle.c
4,579
utf_8
a5c0c617829a6b080b56930c853e350f
/* */ #if defined(__i386__) || defined(__x86_64__) #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include "helpers/helpers.h" #include "idle_monitor/cpupower-monitor.h" #define MSR_PKG_C2_RESIDENCY 0x60D #define MSR_PKG_C7_RESIDENCY 0x3FA #define MSR_CORE_C7_RESIDENCY 0x3FE #define MSR...
google
android
mperf_monitor
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/utils/idle_monitor/mperf_monitor.c
9,459
utf_8
cad67d1da3a9a88e4067944774986931
/* */ #if defined(__i386__) || defined(__x86_64__) #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <limits.h> #include <cpufreq.h> #include "helpers/helpers.h" #include "idle_monitor/cpupower-monitor.h" #define MSR_APERF 0xE8 #define MSR_MPERF 0xE7 #define MSR_TSC 0x10 #define M...
google
android
nhm_idle
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/utils/idle_monitor/nhm_idle.c
4,899
utf_8
fae55cc391e82caa0cf3e1f2c958c045
/* */ #if defined(__i386__) || defined(__x86_64__) #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include "helpers/helpers.h" #include "idle_monitor/cpupower-monitor.h" #define MSR_PKG_C3_RESIDENCY 0x3F8 #define MSR_PKG_C6_RESIDENCY 0x3F9 #define MSR_CORE_C3_RESIDENCY 0x3FC #define MSR...
google
android
cpupower-monitor
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
10,389
utf_8
1cb3ef0de5ba4df629f749f7ede49b83
/* * */ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <signal.h> #include <sys/types.h> #include <sys/wait.h> #include <libgen.h> #include "idle_monitor/cpupower-monitor.h" #include "idle_monitor/idle_monitors.h" #include "helpers/helpers.h" /* Define pointe...
google
android
hsw_ext_idle
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c
4,755
utf_8
807b7af2d00ad79d77164b3a1e0a0789
/* * * Based on SandyBridge monitor. Implements the new package C-states * (PC8, PC9, PC10) coming with a specific Haswell (family 0x45) CPU. */ #if defined(__i386__) || defined(__x86_64__) #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include "helpers/helpers.h" #include "idle_m...
google
android
sysfs
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/lib/sysfs.c
14,871
utf_8
81d98701c5ee920f9764fce513d914af
/* */ #include <stdio.h> #include <errno.h> #include <stdlib.h> #include <string.h> #include <limits.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include "cpufreq.h" #define PATH_TO_CPU "/sys/devices/system/cpu/" #define MAX_LINE_LEN 4096 #define SYSFS_PATH_MAX 255 static uns...
google
android
cpufreq
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/lib/cpufreq.c
3,890
utf_8
6af706a2ae282a5465a22a1be11fcf2d
/* */ #include <stdio.h> #include <errno.h> #include <stdlib.h> #include <string.h> #include "cpufreq.h" #include "sysfs.h" int cpufreq_cpu_exists(unsigned int cpu) { return sysfs_cpu_exists(cpu); } unsigned long cpufreq_get_freq_kernel(unsigned int cpu) { return sysfs_get_freq_kernel(cpu); } unsigned long cpufreq_g...
google
android
main
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/bench/main.c
5,421
utf_8
7dbe80024d362516a40beca23ab6e4aa
/* cpufreq-bench CPUFreq microbenchmark * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <getopt.h> #include <errno.h> #include "config.h" #include "system.h" #include "benchmark.h" static struc...
google
android
parse
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/bench/parse.c
5,378
utf_8
386661f5faf1012d6448c641f00bc104
/* cpufreq-bench CPUFreq microbenchmark * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <time.h> #include <dirent.h> #include <sys/utsname.h> #include <sys/types.h> #include <sys/stat.h> #inclu...
google
android
benchmark
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/bench/benchmark.c
5,607
ibm852
bed9c76e31c9b60631e27510df9dd381
/* cpufreq-bench CPUFreq microbenchmark * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdio.h> #include <unistd.h> #include <math.h> #include "config.h" #include "system.h" #include "benchmark.h" /* Print out progress if we log into a file */ #define show_progress(tota...
google
android
system
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/bench/system.c
4,287
ibm852
8be1769af0ee539f6020c2c3045d4883
/* cpufreq-bench CPUFreq microbenchmark * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdio.h> #include <time.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <sched.h> #include <cpufreq.h> #include "config.h" #include "system.h" /** * retu...
google
android
dump_psb
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/debug/i386/dump_psb.c
3,644
utf_8
eed5d53440095a33c88b5e68d7851dca
/* */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #define _GNU_SOURCE #include <getopt.h> #include <sys/mman.h> #define LEN (0x100000 - 0xc0000) #define OFFSET (0xc0000) #ifndef __packed #define __packed __attribute((packed)) #endif static long relevant; static con...
google
android
intel_gsic
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/debug/i386/intel_gsic.c
2,315
utf_8
a0d34de08cd3a0707886eb560ae1b4cf
/* */ #include <stdio.h> #include <string.h> #include <lrmi.h> int main (void) { struct LRMI_regs r; int retval; if (!LRMI_init()) return 0; memset(&r, 0, sizeof(r)); r.eax = 0x0000E980; r.edx = 0x47534943; retval = LRMI_int(0x15, &r); if (!retval) { printf("Failed!\n"); return 0; } if (r.eax == 0x47...
google
android
powernow-k8-decode
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/debug/i386/powernow-k8-decode.c
1,874
utf_8
75d14e384103bae623782f39b45368dd
/* * * Based on code found in * linux/arch/i386/kernel/cpu/cpufreq/powernow-k8.c * and originally developed by Paul Devriendt */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <unistd.h> #include <errno.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #define MCPU 32 #define ...
google
android
centrino-decode
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/debug/i386/centrino-decode.c
2,053
utf_8
384e88c34754c80cb73eeb7a93b05e75
/* * * Based on code found in * linux/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c * and originally developed by Jeremy Fitzhardinge. * * USAGE: simply run it to decode the current settings on CPU 0, * or pass the CPU number as argument, or pass the MSR content * as argument. */ #include <stdio.h> #in...
google
android
cpufreq-test_tsc
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/power/cpupower/debug/kernel/cpufreq-test_tsc.c
3,083
utf_8
823f399fe9ecc00151d31823c3ef14f2
/* * test module to check whether the TSC-based delay routine continues * to work properly after cpufreq transitions. Needs ACPI to work * properly. * * Based partly on the Power Management Timer (PMTMR) code to be found * in arch/i386/kernel/timers/timer_pm.c on recent 2.6. kernels, especially * code written by...
google
android
hweight
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/hweight.c
1,776
utf_8
c512c70ad1ce15f3b19f36f1be0f6350
#include <linux/bitops.h> #include <asm/types.h> /** * hweightN - returns the hamming weight of a N-bit word * * The Hamming Weight of a number is the total number of bits set in it. */ unsigned int __sw_hweight32(unsigned int w) { #ifdef CONFIG_ARCH_HAS_FAST_MULTIPLIER w -= (w >> 1) & 0x55555555; w = (w & 0x333...
google
android
rbtree
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/rbtree.c
15,047
utf_8
26eddbd8619a367fb25d3ec2f9142c55
/* Red Black Trees along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA linux/lib/rbtree.c */ #include <linux/rbtree_augmented.h> /* * red-black trees properties: http://en.wikipedia.org/wiki/Rbtree * * 1) A node is either red...
google
android
kallsyms
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/symbol/kallsyms.c
1,070
utf_8
d09246b7f34fdba727445fba6da4fbd5
#include "symbol/kallsyms.h" #include <stdio.h> #include <stdlib.h> u8 kallsyms2elf_type(char type) { type = tolower(type); return (type == 't' || type == 'w') ? STT_FUNC : STT_OBJECT; } int kallsyms__parse(const char *filename, void *arg, int (*process_symbol)(void *arg, const char *name, char type, u...
google
android
find_next_bit
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/util/find_next_bit.c
2,123
utf_8
2ae23afb8a7f7fd8234e83ee04117b31
/* find_next_bit.c: fallback find next bit implementation * * Copied from lib/find_next_bit.c to tools/lib/next_bit.c * */ #include <linux/bitops.h> #include <asm/types.h> #include <asm/byteorder.h> #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) #ifndef find_next_bit /* * Find the next set bit in a memory region. ...
google
android
plugin_kmem
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/plugin_kmem.c
2,917
utf_8
4320a4e1e6a768ebe6917515dcea85b1
/* * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "event-parse.h" static int call_site_handler(struct trace_seq *s, struct pevent_record *record, struct event_format *event, void *context) { struct format_...
google
android
kbuffer-parse
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/kbuffer-parse.c
17,485
utf_8
f342a7ffa08131be1a0164c895ce845c
/* * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "kbuffer.h" #define MISSING_EVENTS (1 << 31) #define MISSING_STORED (1 << 30) */ s...
google
android
plugin_hrtimer
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/plugin_hrtimer.c
2,765
utf_8
f6ea24b0fc8ec4a21ebcb22fc3fc8f9a
/* * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "event-parse.h" static int timer_expire_handler(struct trace_seq *s, struct pevent_record *record, struct event_format *event, void *context) { trace_seq_p...
google
android
plugin_scsi
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/plugin_scsi.c
10,859
utf_8
c975dc081c1294f369c536721458fd56
#include <stdio.h> #include <string.h> #include <inttypes.h> #include "event-parse.h" typedef unsigned long sector_t; typedef uint64_t u64; typedef unsigned int u32; /* * SCSI opcodes */ #define TEST_UNIT_READY 0x00 #define REZERO_UNIT 0x01 #define REQUEST_SENSE 0x03 #define FORMAT_UNIT 0x04 #define REAS...
google
android
parse-filter
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/parse-filter.c
52,886
utf_8
8284afa79ee686f62213cf06aa453646
/* * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <errno.h> #include <sys/types.h> #include "event-parse.h" #include "event-utils.h" #define COMM "COMM" static struct format_field comm = { .nam...
google
android
trace-seq
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/trace-seq.c
6,007
utf_8
97c5a067a17ff1daadd3f413dcc7a0b3
/* * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <asm/bug.h> #include "event-parse.h" #include "event-utils.h" /* * The TRACE_SEQ_POISON is to catch the use of using * a trace_seq structure a...
google
android
plugin_jbd2
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/plugin_jbd2.c
2,264
utf_8
8f61b6e352039e469e36516a3834ff65
/* * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "event-parse.h" #define MINORBITS 20 #define MINORMASK ((1U << MINORBITS) - 1) #define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS)) #define MINOR(dev) ((unsigne...
google
android
event-plugin
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/event-plugin.c
10,250
utf_8
1cab6796a5dc1f325cddd7a164c9db27
/* * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <ctype.h> #include <stdio.h> #include <string.h> #include <dlfcn.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <dirent.h> #include "event-parse.h" #include "event-utils.h" ...
google
android
plugin_sched_switch
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/plugin_sched_switch.c
4,476
utf_8
4dd1198665d0584072ee3ce72efdcdca
/* * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "event-parse.h" static void write_state(struct trace_seq *s, int val) { const char states[] = "SDTtZXxW"; int found = 0; int i; for (i = 0; i < (sizeof(states) ...
google
android
plugin_mac80211
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/plugin_mac80211.c
2,860
utf_8
78ecc1029d4420651de170ef3bf3abc7
/* * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "event-parse.h" #define INDENT 65 static void print_string(struct trace_seq *s, struct event_format *event, const char *name, const void *data) { struct format...
google
android
plugin_function
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/plugin_function.c
4,481
utf_8
9978a889616967428a8259c2e9f4aa2d
/* * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "event-parse.h" #include "event-utils.h" static struct func_stack { int size; char **stack; } *fstack; static int cpus = -1; #define STK_BLK 10 struct pevent_plug...
google
android
event-parse
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/event-parse.c
147,084
utf_8
9c193365cced2665b37bc918b2237be9
/* */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <ctype.h> #include <errno.h> #include <stdint.h> #include <limits.h> #include <netinet/ip6.h> #include "event-parse.h" #include "event-utils.h" static const char *input_buf; static unsigned long long input_buf_ptr; static uns...
google
android
plugin_cfg80211
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/plugin_cfg80211.c
957
utf_8
a9e6aa9dc7ee4b6ad6c022f3d466f42e
#include <stdio.h> #include <string.h> #include <inttypes.h> #include <endian.h> #include "event-parse.h" /* * From glibc endian.h, for older systems where it is not present, e.g.: RHEL5, * Fedora6. */ #ifndef le16toh # if __BYTE_ORDER == __LITTLE_ENDIAN # define le16toh(x) (x) # else # define le16toh(x) __bswap_...
google
android
parse-utils
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/parse-utils.c
1,800
utf_8
b3812197e4212df1766901b416eac171
/* * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <errno.h> #define __weak __attribute__((weak)) void __vwarning(const char *fmt, va_list ap) { if (errno) perror("trace-cmd"); errno = 0; fp...
google
android
plugin_kvm
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/plugin_kvm.c
14,005
utf_8
09e4abc1f7fe7b9c7aa2b0192802c477
/* * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include "event-parse.h" #ifdef HAVE_UDIS86 #include <udis86.h> static ud_t ud; static void init_disassembler(void) { ud_init(&ud); ud_set_syntax(&ud, ...
google
android
plugin_xen
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/traceevent/plugin_xen.c
3,533
utf_8
923b3fd8337d108727ea81bb468c3d7c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "event-parse.h" #define __HYPERVISOR_set_trap_table 0 #define __HYPERVISOR_mmu_update 1 #define __HYPERVISOR_set_gdt 2 #define __HYPERVISOR_stack_switch 3 #define __HYPERVISOR_set_callbacks 4 #define __HYPERVISOR_fpu_taskswitch 5 #define...
google
android
cpu
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/api/cpu.c
351
utf_8
b359d2abf4159f3d3a18c4ebd0aac469
#include <stdio.h> #include "cpu.h" #include "fs/fs.h" int cpu__get_max_freq(unsigned long long *freq) { char entry[PATH_MAX]; int cpu; if (sysfs__read_int("devices/system/cpu/online", &cpu) < 0) return -1; snprintf(entry, sizeof(entry), "devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", cpu); return s...
google
android
tracing_path
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/api/fs/tracing_path.c
2,949
utf_8
243fdd3812b361864ed162593bc6afe7
#ifndef _GNU_SOURCE # define _GNU_SOURCE #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <unistd.h> #include "fs.h" #include "tracing_path.h" char tracing_mnt[PATH_MAX] = "/sys/kernel/debug"; char tracing_path[PATH_MAX] = "/sys/kernel/debug/tracing"; char...
google
android
fs
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/api/fs/fs.c
6,242
utf_8
ce613c1c620ba8155041963d98312e3d
#include <ctype.h> #include <errno.h> #include <limits.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/vfs.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include "fs.h" #define _STR(x) #x #define STR(x) _S...
google
android
array
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/api/fd/array.c
2,477
utf_8
b8307cb07a74711cf1395deca7c8c051
/* */ #include "array.h" #include <errno.h> #include <fcntl.h> #include <poll.h> #include <stdlib.h> #include <unistd.h> void fdarray__init(struct fdarray *fda, int nr_autogrow) { fda->entries = NULL; fda->priv = NULL; fda->nr = fda->nr_alloc = 0; fda->nr_autogrow = nr_autogrow; } int fdarray__grow(struct fdar...
google
android
common
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/common.c
660
utf_8
e881bdee5f0a1837580cae78afb6be38
#include <stddef.h> #include <stdbool.h> #include <linux/compiler.h> #include <linux/lockdep.h> #include <unistd.h> #include <sys/syscall.h> static __thread struct task_struct current_obj; /* lockdep wants these */ bool debug_locks = true; bool debug_locks_silent; __attribute__((constructor)) static void liblockdep_...
google
android
lockdep
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/lockdep.c
72
utf_8
141193aab6fd40bd16539160345578ca
#include <linux/lockdep.h> #include "../../../kernel/locking/lockdep.c"
google
android
preload
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/preload.c
12,955
utf_8
56e7a39e5938ebb61530b663a176c92f
#define _GNU_SOURCE #include <pthread.h> #include <stdio.h> #include <dlfcn.h> #include <stdlib.h> #include <sysexits.h> #include "include/liblockdep/mutex.h" #include "../../include/linux/rbtree.h" /** * struct lock_lookup - liblockdep's view of a single unique lock */ struct lock_lookup { void *orig; /* Original p...
google
android
rbtree
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/rbtree.c
33
utf_8
e2738249e70f2c660d811552f1e271b6
#include "../../../lib/rbtree.c"
google
android
ABCDBDDA
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/tests/ABCDBDDA.c
314
utf_8
7bfbcd4ea128a09953bd410c4592914f
#include <liblockdep/mutex.h> #include "common.h" void main(void) { pthread_mutex_t a, b, c, d; pthread_mutex_init(&a, NULL); pthread_mutex_init(&b, NULL); pthread_mutex_init(&c, NULL); pthread_mutex_init(&d, NULL); LOCK_UNLOCK_2(a, b); LOCK_UNLOCK_2(c, d); LOCK_UNLOCK_2(b, d); LOCK_UNLOCK_2(d, a); }
google
android
ABCABC
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/tests/ABCABC.c
258
utf_8
d3274d7410691a02e67e2165e9dbd0e3
#include <liblockdep/mutex.h> #include "common.h" void main(void) { pthread_mutex_t a, b, c; pthread_mutex_init(&a, NULL); pthread_mutex_init(&b, NULL); pthread_mutex_init(&c, NULL); LOCK_UNLOCK_2(a, b); LOCK_UNLOCK_2(c, a); LOCK_UNLOCK_2(b, c); }
google
android
WW
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/tests/WW.c
226
utf_8
59664504819bdb2785c7bfd6e46a1d18
#include <liblockdep/rwlock.h> void main(void) { pthread_rwlock_t a, b; pthread_rwlock_init(&a, NULL); pthread_rwlock_init(&b, NULL); pthread_rwlock_wrlock(&a); pthread_rwlock_rdlock(&b); pthread_rwlock_wrlock(&a); }
google
android
ABBCCDDA
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/tests/ABBCCDDA.c
314
utf_8
1775f0271ae93632c3489ad96400aa2c
#include <liblockdep/mutex.h> #include "common.h" void main(void) { pthread_mutex_t a, b, c, d; pthread_mutex_init(&a, NULL); pthread_mutex_init(&b, NULL); pthread_mutex_init(&c, NULL); pthread_mutex_init(&d, NULL); LOCK_UNLOCK_2(a, b); LOCK_UNLOCK_2(b, c); LOCK_UNLOCK_2(c, d); LOCK_UNLOCK_2(d, a); }
google
android
unlock_balance
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/tests/unlock_balance.c
183
utf_8
e1966a1dd9653b45baa191d049ac3368
#include <liblockdep/mutex.h> void main(void) { pthread_mutex_t a; pthread_mutex_init(&a, NULL); pthread_mutex_lock(&a); pthread_mutex_unlock(&a); pthread_mutex_unlock(&a); }
google
android
ABBA
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/tests/ABBA.c
202
utf_8
e41d5b7e9bc69023c69b46b202451d89
#include <liblockdep/mutex.h> #include "common.h" void main(void) { pthread_mutex_t a, b; pthread_mutex_init(&a, NULL); pthread_mutex_init(&b, NULL); LOCK_UNLOCK_2(a, b); LOCK_UNLOCK_2(b, a); }
google
android
AA
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/tests/AA.c
213
utf_8
59645b8e877ca5108f4d725f2d6e3c84
#include <liblockdep/mutex.h> void main(void) { pthread_mutex_t a, b; pthread_mutex_init(&a, NULL); pthread_mutex_init(&b, NULL); pthread_mutex_lock(&a); pthread_mutex_lock(&b); pthread_mutex_lock(&a); }
google
android
ABBCCA
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/tests/ABBCCA.c
258
utf_8
63d838333fdb697381092d211bb7e1ba
#include <liblockdep/mutex.h> #include "common.h" void main(void) { pthread_mutex_t a, b, c; pthread_mutex_init(&a, NULL); pthread_mutex_init(&b, NULL); pthread_mutex_init(&c, NULL); LOCK_UNLOCK_2(a, b); LOCK_UNLOCK_2(b, c); LOCK_UNLOCK_2(c, a); }
google
android
ABCDBCDA
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/lockdep/tests/ABCDBCDA.c
314
utf_8
1682fcc3179b0140d1a4acc79abaab35
#include <liblockdep/mutex.h> #include "common.h" void main(void) { pthread_mutex_t a, b, c, d; pthread_mutex_init(&a, NULL); pthread_mutex_init(&b, NULL); pthread_mutex_init(&c, NULL); pthread_mutex_init(&d, NULL); LOCK_UNLOCK_2(a, b); LOCK_UNLOCK_2(c, d); LOCK_UNLOCK_2(b, c); LOCK_UNLOCK_2(d, a); }
google
android
libbpf
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/bpf/libbpf.c
24,284
utf_8
ab21d2f093f8fbed6b99a585b3959e2e
/* * Common eBPF ELF object loading operations. * */ #include <stdlib.h> #include <stdio.h> #include <stdarg.h> #include <inttypes.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <asm/unistd.h> #include <linux/kernel.h> #include <linux/bpf.h> #include <linux/list.h> #include...
google
android
bpf
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/lib/bpf/bpf.c
1,977
utf_8
1138569c1b86cfdc4e6d0e7e5deaf27d
/* * common eBPF ELF operations. * */ #include <stdlib.h> #include <memory.h> #include <unistd.h> #include <asm/unistd.h> #include <linux/bpf.h> #include "bpf.h" /* * When building perf, unistd.h is override. Define __NR_bpf is * required to be defined. */ #ifndef __NR_bpf # if defined(__i386__) # define __NR_bp...
google
android
config_check
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/nvdimm/config_check.c
387
utf_8
8c66314ab76549d383b65485787b51cd
#include <linux/kconfig.h> #include <linux/bug.h> void check(void) { /* * These kconfig symbols must be set to "m" for nfit_test to * load and operate. */ BUILD_BUG_ON(!IS_MODULE(CONFIG_LIBNVDIMM)); BUILD_BUG_ON(!IS_MODULE(CONFIG_BLK_DEV_PMEM)); BUILD_BUG_ON(!IS_MODULE(CONFIG_ND_BTT)); BUILD_BUG_ON(!IS_MODU...
google
android
nfit
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/nvdimm/test/nfit.c
40,588
utf_8
add4874b1448778f0cb3a1af59b6c3a1
/* */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/platform_device.h> #include <linux/dma-mapping.h> #include <linux/libnvdimm.h> #include <linux/vmalloc.h> #include <linux/device.h> #include <linux/module.h> #include <linux/mutex.h> #include <linux/ndctl.h> #include <linux/sizes.h> #include <linux/list...
google
android
iomap
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/nvdimm/test/iomap.c
6,160
utf_8
f23e4e5c5eeedcfb1d3da0c0a0db5a02
/* */ #include <linux/rculist.h> #include <linux/export.h> #include <linux/ioport.h> #include <linux/module.h> #include <linux/types.h> #include <linux/io.h> #include "nfit_test.h" static LIST_HEAD(iomap_head); static struct iomap_ops { nfit_test_lookup_fn nfit_test_lookup; struct list_head list; } iomap_ops = { .l...
google
android
open-unlink
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/efivarfs/open-unlink.c
2,216
utf_8
be545c298c4184d4eaf2685e06300f3e
#include <errno.h> #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <linux/fs.h> static int set_immutable(const char *path, int immutable) { unsigned int flags; int fd; int rc; int error; ...
google
android
create-read
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/efivarfs/create-read.c
679
utf_8
149337c1976ab79bcef165df73efd807
#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> #include <string.h> int main(int argc, char **argv) { const char *path; char buf[4]; int fd, rc; if (argc < 2) { fprintf(stderr, "usage: %s <path>\n",...
google
android
fuse_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/memfd/fuse_test.c
7,355
utf_8
da31b8966832f5ea6c661e6f41b032b3
/* * memfd GUP test-case * This tests memfd interactions with get_user_pages(). We require the * fuse_mnt.c program to provide a fake direct-IO FUSE mount-point for us. This * file-system delays _all_ reads by 1s and forces direct-IO. This means, any * read() on files in that file-system will pin the receive-buffe...
google
android
fuse_mnt
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/memfd/fuse_mnt.c
2,248
utf_8
3c41a01d389f15964410262227288f52
/* * memfd test file-system * This file uses FUSE to create a dummy file-system with only one file /memfd. * This file is read-only and takes 1s per read. * * This file-system is used by the memfd test-cases to force the kernel to pin * pages during reads(). Due to the 1s delay of this file-system, this is a * n...
google
android
memfd_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/memfd/memfd_test.c
18,226
utf_8
0158055fcb0e4779ad471425f82779ec
#define _GNU_SOURCE #define __EXPORTED_HEADERS__ #include <errno.h> #include <inttypes.h> #include <limits.h> #include <linux/falloc.h> #include <linux/fcntl.h> #include <linux/memfd.h> #include <sched.h> #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <string.h> #include <sys/mman.h> #include <sys...
google
android
harness
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/harness.c
2,645
utf_8
83559c021addb524fd612a55ee4b1536
/* */ #include <errno.h> #include <signal.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <elf.h> #include <fcntl.h> #include <link.h> #include <sys/stat.h> #include "subunit.h" #include "utils.h" #define TIMEOUT 120 #define KILL...
google
android
l3_bank_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/l3_bank_test.c
784
utf_8
24921298d113a94e347ec795fa56f167
/* */ #include <stdio.h> #include <stdlib.h> #include "event.h" #include "utils.h" #define MALLOC_SIZE (0x10000 * 10) /* Ought to be enough .. */ /* * Tests that the L3 bank handling is correct. We fixed it in commit e9aaac1. */ static int l3_bank_test(void) { struct event event; char *p; int i; p = malloc(...
google
android
per_event_excludes
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/per_event_excludes.c
2,674
utf_8
018d67c54f1707d71f450ee2f0a5a4f0
/* */ #define _GNU_SOURCE #include <elf.h> #include <limits.h> #include <stdio.h> #include <stdbool.h> #include <string.h> #include <sys/prctl.h> #include "event.h" #include "lib.h" #include "utils.h" /* * Test that per-event excludes work. */ static int per_event_excludes(void) { struct event *e, events[4]; char ...
google
android
count_instructions
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/count_instructions.c
3,330
utf_8
d129f80ef208ff45da10343b76c351ad
/* */ #define _GNU_SOURCE #include <stdio.h> #include <stdbool.h> #include <string.h> #include <sys/prctl.h> #include "event.h" #include "utils.h" #include "lib.h" extern void thirty_two_instruction_loop(u64 loops); static void setup_event(struct event *e, u64 config, char *name) { event_init_opts(e, config, PERF_TYP...
google
android
event
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/event.c
2,781
utf_8
7d1d7e8fa781a39131b4c1512fe650da
/* */ #define _GNU_SOURCE #include <unistd.h> #include <sys/syscall.h> #include <string.h> #include <stdio.h> #include <sys/ioctl.h> #include "event.h" int perf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu, int group_fd, unsigned long flags) { return syscall(__NR_perf_event_open, attr, pid, cpu, ...
google
android
lib
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/lib.c
4,154
utf_8
acfc72fd0eaeb7ec3c438b012e6e65b1
/* */ #define _GNU_SOURCE /* For CPU_ZERO etc. */ #include <errno.h> #include <sched.h> #include <setjmp.h> #include <stdlib.h> #include <sys/wait.h> #include "utils.h" #include "lib.h" int pick_online_cpu(void) { cpu_set_t mask; int cpu; CPU_ZERO(&mask); if (sched_getaffinity(0, sizeof(mask), &mask)) { perror("...
google
android
instruction_count_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
3,752
utf_8
7f74f9abb7e7a8fe2c3b48a349f51873
/* */ #define _GNU_SOURCE #include <stdio.h> #include <stdbool.h> #include <string.h> #include <sys/prctl.h> #include "ebb.h" /* * Run a calibrated instruction loop and count instructions executed using * EBBs. Make sure the counts look right. */ extern void thirty_two_instruction_loop(uint64_t loops); static bool ...
google
android
ebb_vs_cpu_event_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/ebb_vs_cpu_event_test.c
1,790
utf_8
a1486fa9dddd84f731c8e0b4fd2ee8e9
/* */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests an EBB vs a cpu event - in that order. The EBB should force the cpu * event off the PMU. */ static int setup_cpu_event(struct event *even...
google
android
close_clears_pmcc_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/close_clears_pmcc_test.c
1,223
utf_8
8e5bd9aa0ca831112cc3a991262d0fcf
/* */ #include <stdio.h> #include <stdlib.h> #include <setjmp.h> #include <signal.h> #include "ebb.h" /* * Test that closing the EBB event clears MMCR0_PMCC, preventing further access * by userspace to the PMU hardware. */ int close_clears_pmcc(void) { struct event event; SKIP_IF(!ebb_is_supported()); event_init...
google
android
ebb_on_child_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/ebb_on_child_test.c
1,736
utf_8
d652f04b96aa2ad107973234b8d1513b
/* */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests we can setup an EBB on our child. Nothing interesting happens, because * even though the event is enabled and running the child hasn't ena...
google
android
ebb
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/ebb.c
9,610
utf_8
6f75bb88d3ad52a396c2828eeecc4ce9
/* */ #define _GNU_SOURCE /* For CPU_ZERO etc. */ #include <sched.h> #include <sys/wait.h> #include <setjmp.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> #include <linux/auxvec.h> #include "trace.h" #include "reg.h" #include "ebb.h" void (*ebb_user_func)(void)...
google
android
lost_exception_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/lost_exception_test.c
2,359
utf_8
76a03c23868852dca240f30f0cb7e3b5
/* */ #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/mman.h> #include "ebb.h" /* * Test that tries to trigger CPU_FTR_PMAO_BUG. Which is a hardware defect * where an exception triggers but we context switch before it is delivered and * lose the exception. */ static int ...
google
android
event_attributes_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/event_attributes_test.c
2,976
utf_8
773e6a142a9b674fb680866326300c19
/* */ #include <stdio.h> #include <stdlib.h> #include "ebb.h" /* * Test various attributes of the EBB event are enforced. */ int event_attributes(void) { struct event event, leader; SKIP_IF(!ebb_is_supported()); event_init(&event, 0x1001e); event_leader_ebb_init(&event); /* Expected to succeed */ FAIL_IF(event...
google
android
back_to_back_ebbs_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/back_to_back_ebbs_test.c
2,214
utf_8
411574a6ec89fd3761a1d07a6d15e7ef
/* */ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include "ebb.h" #define NUMBER_OF_EBBS 50 /* * Test that if we overflow the counter while in the EBB handler, we take * another EBB on exiting from the handler. * * We do this by counting with a stupidly low sample period, causing us to * overflow...
google
android
multi_ebb_procs_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/multi_ebb_procs_test.c
1,903
utf_8
5ca397875173409361e5558bbb7a411f
/* */ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <signal.h> #include "ebb.h" /* * Test running multiple EBB using processes at once on a single CPU. They * should all run happily without interfering with each other. */ static bool child_should_exit; static void sigint_handler(int signal) {...
google
android
cpu_event_pinned_vs_ebb_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/cpu_event_pinned_vs_ebb_test.c
1,949
utf_8
f2d2ffe8cda883db70a7396f6bb734b4
/* */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests a pinned cpu event vs an EBB - in that order. The pinned cpu event * should remain and the EBB event should fail to enable. */ static int...
google
android
fork_cleanup_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/fork_cleanup_test.c
1,549
utf_8
7cc44ec65b27f81133e9cff96469ed3f
/* */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <setjmp.h> #include <signal.h> #include "ebb.h" /* * Test that a fork clears the PMU state of the child. eg. BESCR/EBBHR/EBBRR * are cleared, and MMCR0_PMCC ...
google
android
task_event_pinned_vs_ebb_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/task_event_pinned_vs_ebb_test.c
1,970
utf_8
b5879271471ad1c237d00b0e13abc74b
/* */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests a pinned per-task event vs an EBB - in that order. The pinned per-task * event should prevent the EBB event from being enabled. */ static...
google
android
no_handler_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/no_handler_test.c
1,161
utf_8
c2f27a1addc81265458c9d609b71e0be
/* */ #include <stdio.h> #include <stdlib.h> #include <setjmp.h> #include <signal.h> #include "ebb.h" /* Test that things work sanely if we have no handler */ static int no_handler_test(void) { struct event event; u64 val; int i; SKIP_IF(!ebb_is_supported()); event_init_named(&event, 0x1001e, "cycles"); event_le...
google
android
ebb_on_willing_child_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/ebb_on_willing_child_test.c
1,942
utf_8
c2424957dd9f14f7af2f8a7e310f7c99
/* */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests we can setup an EBB on our child. The child expects this and enables * EBBs, which are then delivered to the child, even though the event ...
google
android
cycles_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/cycles_test.c
1,047
utf_8
e0f1a3ca25c89f82fad33566e7d54495
/* */ #include <stdio.h> #include <stdlib.h> #include "ebb.h" /* * Basic test that counts user cycles and takes EBBs. */ int cycles(void) { struct event event; SKIP_IF(!ebb_is_supported()); event_init_named(&event, 0x1001e, "cycles"); event_leader_ebb_init(&event); event.attr.exclude_kernel = 1; event.attr.exc...
google
android
task_event_vs_ebb_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/task_event_vs_ebb_test.c
1,762
utf_8
8c1b32fba252ca7c51c09a65e0f61ec7
/* */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests a per-task event vs an EBB - in that order. The EBB should push the * per-task event off the PMU. */ static int setup_child_event(struct ...
google
android
cycles_with_freeze_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/cycles_with_freeze_test.c
2,442
utf_8
664b7b3de419ce9767df9df64887dc3b
/* */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include "ebb.h" /* * Test of counting cycles while using MMCR0_FC (freeze counters) to only count * parts of the code. This is complicated by the fact that FC is set by the * hardware when the event overflows. We may take the EBB after we have set F...
google
android
reg_access_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/reg_access_test.c
674
utf_8
eeeff52c472687510d9e3c8f493cb056
/* */ #include <stdio.h> #include <stdlib.h> #include "ebb.h" #include "reg.h" /* * Test basic access to the EBB regs, they should be user accessible with no * kernel interaction required. */ int reg_access(void) { uint64_t val, expected; SKIP_IF(!ebb_is_supported()); expected = 0x8000000100000000ull; mtspr(SPR...
google
android
trace
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/trace.c
5,780
utf_8
13ab91c1d45d8f29385652c828214540
/* */ #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #include "trace.h" struct trace_buffer *trace_buffer_allocate(u64 size) { struct trace_buffer *tb; if (size < sizeof(*tb)) { fprintf(stderr, "Error: trace buffer too small\n"); return NULL; } tb = mmap(NUL...
google
android
pmc56_overflow_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/pmc56_overflow_test.c
1,668
utf_8
63fd5cb124355df4ad3535417bb59170
/* */ #include <stdio.h> #include <stdlib.h> #include "ebb.h" /* * Test that PMC5 & 6 are frozen (ie. don't overflow) when they are not being * used. Tests the MMCR0_FC56 logic in the kernel. */ static int pmc56_overflowed; static void ebb_callee(void) { uint64_t val; val = mfspr(SPRN_BESCR); if (!(val & BESCR_P...
google
android
multi_counter_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/multi_counter_test.c
2,235
utf_8
0796f70f86f4661b138bca3c8d07d9a6
/* */ #include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include "ebb.h" /* * Test counting multiple events using EBBs. */ int multi_counter(void) { struct event events[6]; int i, group_fd; SKIP_IF(!ebb_is_supported()); event_init_named(&events[0], 0x1001C, "PM_CMPLU_STALL_THRD"); event_init_named(&...
google
android
pmae_handling_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/pmae_handling_test.c
2,113
utf_8
0d61cb4a91d289ea2a9d487d38769fea
/* */ #include <sched.h> #include <signal.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include "ebb.h" /* * Test that the kernel properly handles PMAE across context switches. * * We test this by calling into the kernel inside our EBB handler, where PMAE * is clear. A cpu eater companion thread ...
google
android
cpu_event_vs_ebb_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/cpu_event_vs_ebb_test.c
1,760
utf_8
3a5c260e113bc5dc70d693f839833037
/* */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests a cpu event vs an EBB - in that order. The EBB should force the cpu * event off the PMU. */ static int setup_cpu_event(struct event *even...
google
android
cycles_with_mmcr2_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/pmu/ebb/cycles_with_mmcr2_test.c
1,852
utf_8
b647ef4b4392196acb1e05e6302c6312
/* */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include "ebb.h" /* * Test of counting cycles while manipulating the user accessible bits in MMCR2. */ /* We use two values because the first freezes PMC1 and so we would get no EBBs */ #define MMCR2_EXPECTED_1 0x4020100804020000UL /* (FC1P|FC2P|FC3P|...
google
android
vphn
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/vphn/vphn.c
2,035
utf_8
d96646e4fea623217f36f269b29ea149
#include <asm/byteorder.h> #include "vphn.h" /* * The associativity domain numbers are returned from the hypervisor as a * stream of mixed 16-bit and 32-bit fields. The stream is terminated by the * special value of "all ones" (aka. 0xffff) and its size may not exceed 48 * bytes. * * --- 16-bit fields --> * ...
google
android
test-vphn
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/vphn/test-vphn.c
6,679
utf_8
3f29e25eee7a67d93c73ab9804c35259
#include <stdio.h> #include <byteswap.h> #include "utils.h" #include "subunit.h" #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #define cpu_to_be32(x) bswap_32(x) #define be32_to_cpu(x) bswap_32(x) #define be16_to_cpup(x) bswap_16(*x) #define cpu_to_be64(x) bswap_64(x) #else #define cpu_to_be32(x) (x) #define be32...
google
android
dscr_inherit_test
.c
platform/hardware/bsp/kernel/intel/edison-v4.4/tools/testing/selftests/powerpc/dscr/dscr_inherit_test.c
2,199
utf_8
9355cc9850e9e163408780f90417b86d
/* * POWER Data Stream Control Register (DSCR) fork test * * This testcase modifies the DSCR using mtspr, forks and then * verifies that the child process has the correct changed DSCR * value using mfspr. * * When using the privilege state SPR, the instructions such as * mfspr or mtspr are priviledged and the k...