From: Steven Rostedt <rostedt@goodmis.org>
To: Shiju Jose <shiju.jose@huawei.com>
Cc: "dave.jiang@intel.com" <dave.jiang@intel.com>,
"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
"alison.schofield@intel.com" <alison.schofield@intel.com>,
"nifan.cxl@gmail.com" <nifan.cxl@gmail.com>,
"vishal.l.verma@intel.com" <vishal.l.verma@intel.com>,
"ira.weiny@intel.com" <ira.weiny@intel.com>,
"dave@stgolabs.net" <dave@stgolabs.net>,
"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linuxarm <linuxarm@huawei.com>,
tanxiaofei <tanxiaofei@huawei.com>,
"Zengtao (B)" <prime.zeng@hisilicon.com>
Subject: Re: [PATCH v4 3/6] cxl/events: Update General Media Event Record to CXL spec rev 3.1
Date: Wed, 27 Nov 2024 13:34:07 -0500 [thread overview]
Message-ID: <20241127133407.7bc1376a@gandalf.local.home> (raw)
In-Reply-To: <53a299d3cca6417d90d553e8399f834b@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]
On Wed, 27 Nov 2024 18:20:26 +0000
Shiju Jose <shiju.jose@huawei.com> wrote:
> I tested removing hdr_uuid and region_uuid from the rasdaemon test setup
> as you suggested. As a result, libtraceevent parses correctly, as you mentioned.
>
> However, I encounter similar parsing error ("FAILED TO PARSE") when I add two additional
> decoded strings (%s) to the TP_printk, replacing (%u). Please see the attached format file,
> "format_cxl_general_media_v3.1_basic", for your reference.
Are you sure. I don't see anything wrong with that one. Which version of
libtraceevent do you have?
>
> I've also attached another format file, "format_cxl_general_media_v3.1_full",
> which contains the complete TP_printk() intended.
This one has some complex arguments and also uses the '&' address of an
argument.
>
> Can you please help or else can you share how to debug these errors in the
> libtraceevent setup?
Basically, I use the attached program (that just links to libtraceevent).
Note, I need to delete the first line of your files, which has the "cat"
command. But you can run this on the file itself:
./tep_load_event /sys/kernel/tracing/events/cxl/cxl_general_media/format
But you may need to be root to do that. If root just copies that file, you
can then run it as non-root.
# cp /sys/kernel/tracing/events/cxl/cxl_general_media/format /tmp
$ ./tep_load_event /tmp/format
I run it under gdb and see where it fails. But it should let you know if it
will pass or not. I put a breakpoint on tep_warning and when it gets hit, I
examine what it did up to that point.
-- Steve
[-- Attachment #2: tep_load_event.c --]
[-- Type: text/x-c++src, Size: 1627 bytes --]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <event-parse.h>
static char *argv0;
static char *get_this_name(void)
{
static char *this_name;
char *arg;
char *p;
if (this_name)
return this_name;
arg = argv0;
p = arg+strlen(arg);
while (p >= arg && *p != '/')
p--;
p++;
this_name = p;
return p;
}
static void usage(void)
{
char *p = get_this_name();
printf("usage: %s exec\n"
"\n",p);
exit(-1);
}
static void __vdie(const char *fmt, va_list ap, int err)
{
int ret = errno;
char *p = get_this_name();
if (err && errno)
perror(p);
else
ret = -1;
fprintf(stderr, " ");
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
exit(ret);
}
void die(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
__vdie(fmt, ap, 0);
va_end(ap);
}
void pdie(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
__vdie(fmt, ap, 1);
va_end(ap);
}
int main (int argc, char **argv)
{
struct tep_handle *tep;
off_t size;
char *buf;
int ret;
argv0 = argv[0];
if (argc < 2)
usage();
tep = tep_alloc();
if (!tep)
pdie("tep_alloc");
tep_set_loglevel(TEP_LOG_ALL);
ret = open(argv[1], O_RDONLY);
if (ret < 0)
pdie(argv[1]);
size = lseek(ret, 0, SEEK_END);
if (size < 0)
pdie("lseek");
lseek(ret, 0, SEEK_SET);
buf = malloc(size);
if (!buf)
pdie("malloc");
size = read(ret, buf, size);
if (size < 0)
pdie("read");
close(ret);
ret = tep_parse_event(tep, buf, size, "sys");
if (ret < 0)
pdie("tep_parse_event");
free(buf);
tep_free(tep);
return 0;
}
next prev parent reply other threads:[~2024-11-27 18:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-20 9:37 [PATCH v4 0/6] Update Event Records to CXL spec rev 3.1 shiju.jose
2024-11-20 9:37 ` [PATCH v4 1/6] cxl/events: Update Common Event Record " shiju.jose
2024-11-26 17:27 ` Fan Ni
2024-11-27 10:15 ` Shiju Jose
2024-11-20 9:37 ` [PATCH v4 2/6] cxl/events: Add Component Identifier formatting for " shiju.jose
2024-11-20 9:37 ` [PATCH v4 3/6] cxl/events: Update General Media Event Record to " shiju.jose
2024-11-26 11:51 ` Shiju Jose
2024-11-26 17:02 ` Steven Rostedt
2024-11-27 10:12 ` Shiju Jose
2024-11-27 15:41 ` Steven Rostedt
2024-11-27 18:20 ` Shiju Jose
2024-11-27 18:34 ` Steven Rostedt [this message]
2024-11-28 10:01 ` Shiju Jose
2024-11-29 13:22 ` Shiju Jose
2024-12-03 15:21 ` Shiju Jose
2024-12-04 11:35 ` Shiju Jose
2024-11-20 9:37 ` [PATCH v4 4/6] cxl/events: Update DRAM " shiju.jose
2024-11-20 9:37 ` [PATCH v4 5/6] cxl/events: Update Memory Module " shiju.jose
2024-11-20 9:37 ` [PATCH v4 6/6] cxl/test: Update test code for event records " shiju.jose
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=20241127133407.7bc1376a@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=nifan.cxl@gmail.com \
--cc=prime.zeng@hisilicon.com \
--cc=shiju.jose@huawei.com \
--cc=tanxiaofei@huawei.com \
--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