/* Copyright (c) 2016 Facebook * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. */ #include #include #include #include #include #include "bpf_helpers.h" struct key_t { char comm[TASK_COMM_LEN]; u32 kernstack; u32 userstack; }; struct bpf_map_def SEC("maps") counts = { .type = BPF_MAP_TYPE_HASH, .key_size = sizeof(struct key_t), .value_size = sizeof(u64), .max_entries = 10000, }; struct bpf_map_def SEC("maps") stackmap = { .type = BPF_MAP_TYPE_STACK_TRACE, .key_size = sizeof(u32), .value_size = PERF_MAX_STACK_DEPTH * sizeof(u64), .max_entries = 10000, }; #define KERN_STACKID_FLAGS (0 | BPF_F_FAST_STACK_CMP) #define USER_STACKID_FLAGS (0 | BPF_F_FAST_STACK_CMP | BPF_F_USER_STACK) SEC("perf_event") int bpf_prog1(struct bpf_perf_event_data *ctx) { char fmt[] = "CPU-%d period %lld ip %llx"; u32 cpu = bpf_get_smp_processor_id(); struct key_t key; u64 *val, one = 1; if (ctx->sample_period < 10000) /* ignore warmup */ return 0; bpf_get_current_comm(&key.comm, sizeof(key.comm)); key.kernstack = bpf_get_stackid(ctx, &stackmap, KERN_STACKID_FLAGS); key.userstack = bpf_get_stackid(ctx, &stackmap, USER_STACKID_FLAGS); if ((int)key.kernstack < 0 && (int)key.userstack < 0) { bpf_trace_printk(fmt, sizeof(fmt), cpu, ctx->sample_period, PT_REGS_IP(&ctx->regs)); return 0; } val = bpf_map_lookup_elem(&counts, &key); if (val) (*val)++; else bpf_map_update_elem(&counts, &key, &one, BPF_NOEXIST); return 0; } char _license[] SEC("license") = "GPL"; mhl.h'>logtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mayer <mmayer@broadcom.com>2016-12-19 12:10:27 -0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-01-27 11:43:48 +0100
commit9b02c54bc951fca884ba5719f42a27e8240965bf (patch)
tree68292e54c6d3482d6b55fc31b3ab9519307b255a /include/drm/bridge/mhl.h
parent7a308bb3016f57e5be11a677d15b821536419d36 (diff)
cpufreq: brcmstb-avs-cpufreq: extend sysfs entry brcm_avs_pmap
We extend the brcm_avs_pmap sysfs entry (which issues the GET_PMAP command to AVS) to include all fields from struct pmap. This means adding mode (AVS, DVS, DVFS) and state (the P-state) to the output. Signed-off-by: Markus Mayer <mmayer@broadcom.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/drm/bridge/mhl.h')