Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-cxl@vger.kernel.org, dan.j.williams@intel.com,
	ira.weiny@intel.com, vishal.l.verma@intel.com,
	alison.schofield@intel.com
Subject: Re: [PATCH v3 03/10] cxl: add common function to enable event trace
Date: Thu, 3 Nov 2022 09:21:52 -0700	[thread overview]
Message-ID: <f84551dc-73e6-c1b2-eba7-2718e0472318@intel.com> (raw)
In-Reply-To: <20221103020032.47cb3da7@rorschach.local.home>



On 11/2/2022 11:00 PM, Steven Rostedt wrote:
> On Wed, 02 Nov 2022 14:20:21 -0700
> Dave Jiang <dave.jiang@intel.com> wrote:
> 
>> Add a common function for cxl command to enable event tracing for the
>> instance created. The interested "systems" will be enabled for tracing
>> as well.
>>
>> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
>> ---
>>   cxl/event_trace.c |   21 +++++++++++++++++++++
>>   cxl/event_trace.h |    1 +
>>   2 files changed, 22 insertions(+)
>>
>> diff --git a/cxl/event_trace.c b/cxl/event_trace.c
>> index cf63d2346f6e..d59e54c33df6 100644
>> --- a/cxl/event_trace.c
>> +++ b/cxl/event_trace.c
>> @@ -200,3 +200,24 @@ int cxl_parse_events(struct tracefs_instance *inst, struct event_ctx *ectx)
>>   	tep_free(tep);
>>   	return rc;
>>   }
>> +
>> +int cxl_event_tracing_enable(struct tracefs_instance *inst, const char *system)
>> +{
>> +	int rc;
>> +	char *path;
>> +
>> +	rc = asprintf(&path, "events/%s/enable", system);
>> +	if (rc == -1)
>> +		return -errno;
>> +
>> +	rc = tracefs_instance_file_write(inst, path, "1");
>> +	free(path);
>> +	if (rc == -1)
>> +		return -errno;
> 
> Latest libtracefs has:
> 
> 	tracefs_event_enable(inst, system, NULL);
> 
> That enables all events for a system in the instance "inst".

Great. Thanks! I will switch to that.

> 
> -- Steve
> 
> 
>> +
>> +	if (tracefs_trace_is_on(inst))
>> +		return 0;
>> +
>> +	tracefs_trace_on(inst);
>> +	return 0;
>> +}
>> diff --git a/cxl/event_trace.h b/cxl/event_trace.h
>> index 582882c1eb35..0258b8dc65a3 100644
>> --- a/cxl/event_trace.h
>> +++ b/cxl/event_trace.h
>> @@ -20,5 +20,6 @@ struct event_ctx {
>>   };
>>   
>>   int cxl_parse_events(struct tracefs_instance *inst, struct event_ctx *ectx);
>> +int cxl_event_tracing_enable(struct tracefs_instance *inst, const char *system);
>>   
>>   #endif
>>
> 

  reply	other threads:[~2022-11-03 16:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 21:20 [PATCH v3 00/10] cxl: add monitor support for trace events Dave Jiang
2022-11-02 21:20 ` [PATCH v3 01/10] cxl: add helper function to parse trace event to json object Dave Jiang
2022-11-03  5:48   ` Steven Rostedt
2022-11-03 16:15     ` Dave Jiang
2022-11-04 18:56       ` Ira Weiny
2022-11-14 17:32         ` Steven Rostedt
2022-11-14 20:44           ` Alison Schofield
2022-11-14 20:53             ` Steven Rostedt
2022-11-02 21:20 ` [PATCH v3 02/10] cxl: add helper to parse through all current events Dave Jiang
2022-11-02 21:20 ` [PATCH v3 03/10] cxl: add common function to enable event trace Dave Jiang
2022-11-03  6:00   ` Steven Rostedt
2022-11-03 16:21     ` Dave Jiang [this message]
2022-11-02 21:20 ` [PATCH v3 04/10] cxl: add common function to disable " Dave Jiang
2022-11-03  6:02   ` Steven Rostedt
2022-11-03 16:30     ` Dave Jiang
2022-11-02 21:20 ` [PATCH v3 05/10] cxl: add monitor function for event trace events Dave Jiang
2022-11-03  6:06   ` Steven Rostedt
2022-11-03 16:34     ` Dave Jiang
2022-11-02 21:20 ` [PATCH v3 06/10] cxl: add logging functions for monitor Dave Jiang
2022-11-02 21:20 ` [PATCH v3 07/10] cxl: add monitor command to cxl Dave Jiang
2022-11-02 21:20 ` [PATCH v3 08/10] cxl: add an optional pid check to event parsing Dave Jiang
2022-11-03  6:08   ` Steven Rostedt
2022-11-03 15:57     ` Alison Schofield
2022-11-02 21:20 ` [PATCH v3 09/10] cxl: add systemd service for monitor Dave Jiang
2022-11-02 21:21 ` [PATCH v3 10/10] cxl: add man page documentation " Dave Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f84551dc-73e6-c1b2-eba7-2718e0472318@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox