{"push_id":2732804909,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"e36f9e16ed284c638315d1d332637039b3fa660c","before":"5965fdc248490aefc51d6573f5331db248a0d680","commits":[{"sha":"e36f9e16ed284c638315d1d332637039b3fa660c","author":{"name":"Nikita V. Shirokov","email":"1e71328f994677a148404968ec30435ab1dda7fb@tehnerd.com"},"message":"[profile.py]: adding support to collect profile only from specified CPU (#1891)\n\n* [profile.py]: adding support to collect profile only from specified CPU\r\n\r\nSummary:\r\nsometime it is usefull to collect stack only from single cpu\r\nfor example you have single core saturated while others dont and you\r\nwant to know whats going on there. in this diff i'm adding this ability\r\n(network related code could be example of when single core is saturated\r\nas usually you have 1 to 1 mappng between rx queue and cpu)\r\n\r\nexample of generated code w/ CPU specified:\r\n\r\n./tools/profile.py -C 14 2 --ebpf\r\nSampling at 49 Hertz of all threads by user + kernel stack for 2 secs.\r\n\r\nstruct key_t {\r\n    u32 pid;\r\n    u64 kernel_ip;\r\n    u64 kernel_ret_ip;\r\n    int user_stack_id;\r\n    int kernel_stack_id;\r\n    char name[TASK_COMM_LEN];\r\n};\r\nBPF_HASH(counts, struct key_t);\r\nBPF_STACK_TRACE(stack_traces, 16384);\r\n\r\n// This code gets a bit complex. Probably not suitable for casual hacking.\r\n\r\nint do_perf_event(struct bpf_perf_event_data *ctx) {\r\n\r\n    if (bpf_get_smp_processor_id() != 14)\r\n        return 0;\r\n\r\n    u32 pid = bpf_get_current_pid_tgid() >> 32;\r\n...\r\n\r\nand w/o\r\n\r\n./tools/profile.py  2 --ebpf\r\nSampling at 49 Hertz of all threads by user + kernel stack for 2 secs.\r\n\r\nstruct key_t {\r\n    u32 pid;\r\n    u64 kernel_ip;\r\n    u64 kernel_ret_ip;\r\n    int user_stack_id;\r\n    int kernel_stack_id;\r\n    char name[TASK_COMM_LEN];\r\n};\r\nBPF_HASH(counts, struct key_t);\r\nBPF_STACK_TRACE(stack_traces, 16384);\r\n\r\n// This code gets a bit complex. Probably not suitable for casual hacking.\r\n\r\nint do_perf_event(struct bpf_perf_event_data *ctx) {\r\n\r\n    u32 pid = bpf_get_current_pid_tgid() >> 32;\r\n    if (!(1))\r\n        return 0;\r\n...\r\n\r\n* addressing comments\r\n\r\n* adding change in man","distinct":true,"url":"https://api.github.com/repos/iovisor/bcc/commits/e36f9e16ed284c638315d1d332637039b3fa660c"}]}
{"actor":{"display_login":"yonghong-song"}}