From: Deepak R Varma <drv@mailo.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Saurabh Singh Sengar <ssengar@microsoft.com>,
Praveen Kumar <kumarpraveen@linux.microsoft.com>,
Deepak R Varma <drv@mailo.com>
Subject: Re: [PATCH v2 1/3] perf/x86/core: Use sysfs_emit() in show() callback function
Date: Sun, 26 Feb 2023 23:06:45 +0530 [thread overview]
Message-ID: <Y/uYrf1M0R4lZZb1@ubun2204.myguest.virtualbox.org> (raw)
In-Reply-To: <Y/bx0Q6XRv0mNdAT@ubun2204.myguest.virtualbox.org>
On Thu, Feb 23, 2023 at 10:25:45AM +0530, Deepak R Varma wrote:
> On Wed, Feb 22, 2023 at 09:35:53PM +0100, Peter Zijlstra wrote:
> > On Tue, Feb 21, 2023 at 07:36:12PM +0530, Deepak R Varma wrote:
> > > diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
> > > index 85a63a41c471..27c03e6dcb5d 100644
> > > --- a/arch/x86/events/core.c
> > > +++ b/arch/x86/events/core.c
> > > @@ -1896,9 +1896,7 @@ ssize_t events_hybrid_sysfs_show(struct device *dev,
> > > if (x86_pmu.hybrid_pmu[i].cpu_type & pmu->cpu_type) {
> > > next_str = strchr(str, ';');
> > > if (next_str)
> > > - return snprintf(page, next_str - str + 1, "%s", str);
> > > - else
> > > - return sprintf(page, "%s", str);
> > > + return sysfs_emit(page, "%s", str);
> > > }
> > > str = strchr(str, ';');
> > > str++;
> >
> > How is this correct ?!?
>
> oops.. that is bad on my part. My apologies for the wrong code.
> I will correct it and send in v3.
Hello Peter,
I reviewed the code more closely and concluded that the current implementation
is better as is. I sent in a v3 with necessary correction for your review.
I do have another observation from this area that I will send in as a separate
patch soon.
Thank you again.
./drv
>
> Thank you Peter.
>
> Regards,
> ./drv
next prev parent reply other threads:[~2023-02-26 17:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 14:05 [PATCH v2 0/3] perf/x86: Use sysfs_emit() in show() callback function Deepak R Varma
2023-02-21 14:06 ` [PATCH v2 1/3] perf/x86/core: " Deepak R Varma
2023-02-22 20:35 ` Peter Zijlstra
2023-02-23 4:55 ` Deepak R Varma
2023-02-26 17:36 ` Deepak R Varma [this message]
2023-02-21 14:06 ` [PATCH v2 2/3] perf/x86/intel/pt: " Deepak R Varma
2023-02-21 14:07 ` [PATCH v2 3/3] perf/x86/intel: " Deepak R Varma
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=Y/uYrf1M0R4lZZb1@ubun2204.myguest.virtualbox.org \
--to=drv@mailo.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=kumarpraveen@linux.microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ssengar@microsoft.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).