Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp6389255ybp; Tue, 15 Oct 2019 14:17:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjqM3eMkAA74mTy4aj9KzqeN0XKbSfC1EZXB5Qj88Wt7sZL/AZQeAv6h7Ju+L6Y3rpongu X-Received: by 2002:a50:b966:: with SMTP id m93mr35586038ede.228.1571174250429; Tue, 15 Oct 2019 14:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571174250; cv=none; d=google.com; s=arc-20160816; b=NCHEyAmkpXONXobkreXE7UNac6Kp2ksGbR0GPyzzE2BRRIypLF+NyR26Ye5Mv1TKm0 q0Cqj/bt5um1+Dd4qsZ1/8bDTuhTZX2+Tl1IGx4xkaT+fYI+3aAoBj1AILms7pPVANEo Z48atXUZJl3lZknmUUr/d0rgO2GS2zvPlEyZi+auMxnlLd4yM1C5dY3z9jGuFo1BSNT/ a03tJVI0A3CVyOANxT25lM8cT6AAroE2i4iJurraVWMAdB+2OYA9ThdPeRPIjqocS9sJ unx30RpVApTgYRWEMuwyiazhb80WB/YTUKIeBdoKC/8AecwttMUGV+DpoO3oLR1+jUSM tqsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=lklr1WlXwEy8HhuMw9IdN8QQ3wmV9zb+TDGn5rsLZvA=; b=O3aJhSVGZ2iC2pjkk7VqQogR4SNc9zU4tQj6OB54K9V4El4UMMbgTevx507Rjgi3W5 Zm+cpPYaq9zpVshYPD8OfUetoxcF+y/9Cd1l8txRPjqyMrsiNP3k4zQSPVakxbNgbEGD svpSSJx8bMXXtoJYmCyrrPVGg7VnQ2L9tW2gGVsm7HMdkqDpir7Wou2GjjY1dnNGdUpz Zw7MTxSaT/IyDPPqesn2EN+YkpKAi5a54Ntwb9uATZfRCzFTInm/5ClYaKwtwrRUGzXM dLPHbwJ+5VN3UtCudl8Y/lsgNOqkbCU6InmHtvpS2XJ7VRrC6vCB1q+1diR+scvHiW8w s8Zg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q28si14433756eda.322.2019.10.15.14.17.06; Tue, 15 Oct 2019 14:17:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729034AbfJORFj convert rfc822-to-8bit (ORCPT + 99 others); Tue, 15 Oct 2019 13:05:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:40956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbfJORFj (ORCPT ); Tue, 15 Oct 2019 13:05:39 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2975E2084B; Tue, 15 Oct 2019 17:05:38 +0000 (UTC) Date: Tue, 15 Oct 2019 13:05:36 -0400 From: Steven Rostedt To: Divya Indi Cc: linux-kernel@vger.kernel.org, Joe Jin , Srinivas Eeda , Aruna Ramakrishna , Manjunath Patil Subject: Re: [PATCH] tracing: Sample module to demonstrate kernel access to Ftrace instances. Message-ID: <20191015130536.3b1f5bf6@gandalf.local.home> In-Reply-To: <1569023966-23004-2-git-send-email-divya.indi@oracle.com> References: <1569023966-23004-1-git-send-email-divya.indi@oracle.com> <1569023966-23004-2-git-send-email-divya.indi@oracle.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Sep 2019 16:59:26 -0700 Divya Indi wrote: > This is a sample module to demostrate the use of the newly introduced and > exported APIs to access Ftrace instances from within the kernel. > > Newly introduced APIs used here - > > 1. Create a new trace array if it does not exist. > struct trace_array *trace_array_create(const char *name) > > 2. Destroy/Remove a trace array. > int trace_array_destroy(struct trace_array *tr) > > 3. Lookup a trace array, given its name. > struct trace_array *trace_array_lookup(const char *name) > > 4. Enable/Disable trace events: > int trace_array_set_clr_event(struct trace_array *tr, const char *system, > const char *event, int set); > > Exported APIs - > 1. trace_printk equivalent for instances. > int trace_array_printk(struct trace_array *tr, > unsigned long ip, const char *fmt, ...); > > 2. Helper function. > void trace_printk_init_buffers(void); > > 3. To decrement the reference counter. > void trace_array_put(struct trace_array *tr) > > Signed-off-by: Divya Indi > Reviewed-by: Manjunath Patil > Reviewed-by: Joe Jin > --- > samples/Kconfig | 7 ++ > samples/Makefile | 1 + > samples/ftrace_instance/Makefile | 6 ++ > samples/ftrace_instance/sample-trace-array.c | 134 +++++++++++++++++++++++++++ > samples/ftrace_instance/sample-trace-array.h | 84 +++++++++++++++++ > 5 files changed, 232 insertions(+) > create mode 100644 samples/ftrace_instance/Makefile > create mode 100644 samples/ftrace_instance/sample-trace-array.c > create mode 100644 samples/ftrace_instance/sample-trace-array.h > I applied this patch but get this: /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c: In function ‘mytimer_handler’: /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:35:2: error: implicit declaration of function ‘trace_array_set_clr_event’; did you mean ‘trace_set_clr_event’? [-Werror=implicit-function-declaration] trace_array_set_clr_event(tr, "sample-subsystem", "sample_event", 0); ^~~~~~~~~~~~~~~~~~~~~~~~~ trace_set_clr_event /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c: In function ‘simple_thread_func’: /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:47:2: error: implicit declaration of function ‘trace_array_printk’; did you mean ‘trace_seq_printf’? [-Werror=implicit-function-declaration] trace_array_printk(tr, _THIS_IP_, "trace_array_printk: count=%d\n", ^~~~~~~~~~~~~~~~~~ trace_seq_printf /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c: In function ‘simple_thread’: /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:85:2: error: implicit declaration of function ‘trace_array_put’; did you mean ‘trace_seq_putc’? [-Werror=implicit-function-declaration] trace_array_put(tr); ^~~~~~~~~~~~~~~ trace_seq_putc /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c: In function ‘sample_trace_array_init’: /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:100:7: error: implicit declaration of function ‘trace_array_lookup’; did you mean ‘radix_tree_lookup’? [-Werror=implicit-function-declaration] tr = trace_array_lookup("sample-instance"); ^~~~~~~~~~~~~~~~~~ radix_tree_lookup /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:100:5: warning: assignment to ‘struct trace_array *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] tr = trace_array_lookup("sample-instance"); ^ /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:102:8: error: implicit declaration of function ‘trace_array_create’; did you mean ‘ftrace_force_update’? [-Werror=implicit-function-declaration] tr = trace_array_create("sample-instance"); ^~~~~~~~~~~~~~~~~~ ftrace_force_update /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:102:6: warning: assignment to ‘struct trace_array *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] tr = trace_array_create("sample-instance"); ^ /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:110:2: error: implicit declaration of function ‘trace_printk_init_buffers’; did you mean ‘trace_event_get_offsets’? [-Werror=implicit-function-declaration] trace_printk_init_buffers(); ^~~~~~~~~~~~~~~~~~~~~~~~~ trace_event_get_offsets /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c: In function ‘sample_trace_array_exit’: /work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:126:2: error: implicit declaration of function ‘trace_array_destroy’; did you mean ‘assoc_array_destroy’? [-Werror=implicit-function-declaration] trace_array_destroy(tr); ^~~~~~~~~~~~~~~~~~~ assoc_array_destroy cc1: some warnings being treated as errors make[3]: *** [/work/git/linux-trace.git/scripts/Makefile.build:266: samples/ftrace_instance/sample-trace-array.o] Error 1 make[2]: *** [/work/git/linux-trace.git/scripts/Makefile.build:509: samples/ftrace_instance] Error 2 make[1]: *** [/work/git/linux-trace.git/Makefile:1650: samples] Error 2 make[1]: *** Waiting for unfinished jobs.... -- Steve