Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: <alison.schofield@intel.com>, Vishal Verma <vishal.l.verma@intel.com>
Cc: <nvdimm@lists.linux.dev>, <linux-cxl@vger.kernel.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v6 2/7] cxl: add an optional pid check to event parsing
Date: Fri, 19 Jan 2024 11:35:26 -0700	[thread overview]
Message-ID: <3fadeff6-3074-49f4-9a04-f1e5ef79c962@intel.com> (raw)
In-Reply-To: <77d576abb7e7f9badbb0c117935ad1bcc74899bd.1705534719.git.alison.schofield@intel.com>



On 1/17/24 17:28, alison.schofield@intel.com wrote:
> From: Alison Schofield <alison.schofield@intel.com>
> 
> When parsing CXL events, callers may only be interested in events
> that originate from the current process. Introduce an optional
> argument to the event trace context: event_pid. When event_pid is
> present, simply skip the parsing of events without a matching pid.
> It is not a failure to see other, non matching events.
> 
> The initial use case for this is device poison listings where
> only the media-error records requested by this process are wanted.
> 
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  cxl/event_trace.c | 5 +++++
>  cxl/event_trace.h | 1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/cxl/event_trace.c b/cxl/event_trace.c
> index db8cc85f0b6f..269060898118 100644
> --- a/cxl/event_trace.c
> +++ b/cxl/event_trace.c
> @@ -208,6 +208,11 @@ static int cxl_event_parse(struct tep_event *event, struct tep_record *record,
>  			return 0;
>  	}
>  
> +	if (event_ctx->event_pid) {
> +		if (event_ctx->event_pid != tep_data_pid(event->tep, record))
> +			return 0;
> +	}
> +
>  	if (event_ctx->parse_event)
>  		return event_ctx->parse_event(event, record,
>  					      &event_ctx->jlist_head);
> diff --git a/cxl/event_trace.h b/cxl/event_trace.h
> index ec6267202c8b..7f7773b2201f 100644
> --- a/cxl/event_trace.h
> +++ b/cxl/event_trace.h
> @@ -15,6 +15,7 @@ struct event_ctx {
>  	const char *system;
>  	struct list_head jlist_head;
>  	const char *event_name; /* optional */
> +	int event_pid; /* optional */
>  	int (*parse_event)(struct tep_event *event, struct tep_record *record,
>  			   struct list_head *jlist_head); /* optional */
>  };

  reply	other threads:[~2024-01-19 18:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18  0:27 [ndctl PATCH v6 0/7] Support poison list retrieval alison.schofield
2024-01-18  0:28 ` [PATCH v6 1/7] libcxl: add interfaces for GET_POISON_LIST mailbox commands alison.schofield
2024-01-19 18:32   ` Dave Jiang
2024-01-18  0:28 ` [PATCH v6 2/7] cxl: add an optional pid check to event parsing alison.schofield
2024-01-19 18:35   ` Dave Jiang [this message]
2024-01-18  0:28 ` [PATCH v6 3/7] cxl/event_trace: add a private context for private parsers alison.schofield
2024-01-19 21:08   ` Dave Jiang
2024-01-18  0:28 ` [PATCH v6 4/7] cxl/event_trace: add helpers get_field_[string|data]() alison.schofield
2024-01-19 21:18   ` Dave Jiang
2024-01-18  0:28 ` [PATCH v6 5/7] cxl/list: collect and parse media_error records alison.schofield
2024-01-18  0:28 ` [PATCH v6 6/7] cxl/list: add --media-errors option to cxl list alison.schofield
2024-01-18  0:28 ` [PATCH v6 7/7] cxl/test: add cxl-poison.sh unit test alison.schofield
2024-01-18 21:56 ` [ndctl PATCH v6 0/7] Support poison list retrieval Dan Williams
2024-01-18 23:34   ` Alison Schofield
2024-01-18 23:55     ` Dan Williams
2024-02-07 22:54       ` Alison Schofield

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=3fadeff6-3074-49f4-9a04-f1e5ef79c962@intel.com \
    --to=dave.jiang@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --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