Thread (22 messages) flat view 22 messages, 4 authors, 2018-12-17

Re: [PATCH v3 perf, bpf-next 1/4] perf, bpf: Introduce PERF_RECORD_BPF_EVENT

From: Song Liu <hidden>
Date: 2018-12-12 16:50:09
Also in: lkml

On Dec 12, 2018, at 4:06 AM, Peter Zijlstra [off-list ref] wrote:

On Tue, Dec 11, 2018 at 03:33:47PM -0800, Song Liu wrote:
quoted
+static void perf_event_bpf_output(struct perf_event *event,
+				   void *data)
+{
+	struct perf_bpf_event *bpf_event = data;
+	struct perf_output_handle handle;
+	struct perf_sample_data sample;
+	char name[KSYM_NAME_LEN];
+	int name_len;
+	int ret;
+
+	if (!perf_event_bpf_match(event))
+		return;
+
+	/* get prog name and round up to 64 bit aligned */
+	bpf_get_prog_name(bpf_event->prog, name);
+	name_len = strlen(name) + 1;
+	while (!IS_ALIGNED(name_len, sizeof(u64)))
+		name[name_len++] = '\0';
Does this not require something like:

	BUILD_BUG_ON(KSYM_NAME_LEN % sizeof(u64));
Yeah, this makes sense. I will add this in next version. 

Thanks,
Song
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help