Fix compiler error in KsSession.cpp on Raspberry Pi 3
diff mbox series

Message ID 20190612035902.16366-1-amikhak@wirelessfabric.com
State Accepted
Commit 355108bf9429b4f1ccc801f9b34d98abf8af63b5
Headers show
Series
  • Fix compiler error in KsSession.cpp on Raspberry Pi 3
Related show

Commit Message

Alan Mikhak June 12, 2019, 3:59 a.m. UTC
Fix compiler error at KsSession.cpp:457:30 on Raspberry Pi 3

Fix by changing the type of local variable 'pos' from uint64_t to
size_t in KsSession::loadDualMarker().

KsSession.cpp:457:30: error: no matching function for call to
‘KsSession::_getMarker(const char [6], uint64_t*)’
  if (_getMarker("markA", &pos)) {
                              ^
In file included from KsSession.cpp:14:0:
KsSession.hpp:97:7: note: candidate:
 bool KsSession::_getMarker(const char*, size_t*)
  bool _getMarker(const char* name, size_t *pos);
       ^~~~~~~~~~
KsSession.hpp:97:7: note:   no known conversion for
argument 2 from ‘uint64_t* {aka long long unsigned int*}’
to ‘size_t* {aka unsigned int*}’

Signed-off-by: Alan Mikhak <amikhak@wirelessfabric.com>
---
 kernel-shark/src/KsSession.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Yordan Karadzhov June 12, 2019, 7:34 a.m. UTC | #1
On 12.06.19 г. 6:59 ч., Alan Mikhak wrote:
> Fix compiler error at KsSession.cpp:457:30 on Raspberry Pi 3
> 
> Fix by changing the type of local variable 'pos' from uint64_t to
> size_t in KsSession::loadDualMarker().
> 
> KsSession.cpp:457:30: error: no matching function for call to
> ‘KsSession::_getMarker(const char [6], uint64_t*)’
>    if (_getMarker("markA", &pos)) {
>                                ^
> In file included from KsSession.cpp:14:0:
> KsSession.hpp:97:7: note: candidate:
>   bool KsSession::_getMarker(const char*, size_t*)
>    bool _getMarker(const char* name, size_t *pos);
>         ^~~~~~~~~~
> KsSession.hpp:97:7: note:   no known conversion for
> argument 2 from ‘uint64_t* {aka long long unsigned int*}’
> to ‘size_t* {aka unsigned int*}’
> 
> Signed-off-by: Alan Mikhak <amikhak@wirelessfabric.com>
> ---
>   kernel-shark/src/KsSession.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel-shark/src/KsSession.cpp b/kernel-shark/src/KsSession.cpp
> index 9d86776..a581bbf 100644
> --- a/kernel-shark/src/KsSession.cpp
> +++ b/kernel-shark/src/KsSession.cpp
> @@ -450,7 +450,7 @@ void KsSession::saveDualMarker(KsDualMarkerSM *dm)
>    */
>   void KsSession::loadDualMarker(KsDualMarkerSM *dm, KsTraceGraph *graphs)
>   {
> -	uint64_t pos;
> +	size_t pos;
>   
>   	dm->reset();
>   	dm->setState(DualMarkerState::A);
> 


Hi Alan,
Thanks a lot for this fix!

Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>

I am really curious to know how does KernelShark look and feel on 
Raspberry Pi. Would you shared with us your impressions.
Honestly, I will be surprised if everything works fine ;)

Cheers,
Yordan
Yordan Karadzhov June 12, 2019, 8:17 a.m. UTC | #2
Hi Alan,

I just noticed that you created couple of issues in the issue tracker of 
the Steven's mirror repo on GitHub. Please note that the official 
repository of the project is here
  https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/

and that the issue tracker that we use is here
 
https://bugzilla.kernel.org/buglist.cgi?component=Trace-cmd%2FKernelshark&product=Tools&resolution=---

Also I would like to ask you to copy the content of the trace data 
visualization issue in the official issue tracker, because I find your 
investigations interesting, and I think that this information can be 
useful for someone else having the same problem.

Thanks!
Yordan
Steven Rostedt June 12, 2019, 12:11 p.m. UTC | #3
On Wed, 12 Jun 2019 08:17:38 +0000
Yordan Karadzhov <ykaradzhov@vmware.com> wrote:

> Hi Alan,
> 
> I just noticed that you created couple of issues in the issue tracker of 
> the Steven's mirror repo on GitHub. Please note that the official 
> repository of the project is here
>   https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/
> 
> and that the issue tracker that we use is here
>  
> https://bugzilla.kernel.org/buglist.cgi?component=Trace-cmd%2FKernelshark&product=Tools&resolution=---
> 
> Also I would like to ask you to copy the content of the trace data 
> visualization issue in the official issue tracker, because I find your 
> investigations interesting, and I think that this information can be 
> useful for someone else having the same problem.

Thanks Yordan for pointing this out. I have disabled "Issues" from the
github repository.

-- Steve
Steven Rostedt June 12, 2019, 12:12 p.m. UTC | #4
On Wed, 12 Jun 2019 07:34:35 +0000
Yordan Karadzhov <ykaradzhov@vmware.com> wrote:

> On 12.06.19 г. 6:59 ч., Alan Mikhak wrote:
> > Fix compiler error at KsSession.cpp:457:30 on Raspberry Pi 3
> > 
> > Fix by changing the type of local variable 'pos' from uint64_t to
> > size_t in KsSession::loadDualMarker().
> > 
> > KsSession.cpp:457:30: error: no matching function for call to
> > ‘KsSession::_getMarker(const char [6], uint64_t*)’
> >    if (_getMarker("markA", &pos)) {
> >                                ^
> > In file included from KsSession.cpp:14:0:
> > KsSession.hpp:97:7: note: candidate:
> >   bool KsSession::_getMarker(const char*, size_t*)
> >    bool _getMarker(const char* name, size_t *pos);
> >         ^~~~~~~~~~
> > KsSession.hpp:97:7: note:   no known conversion for
> > argument 2 from ‘uint64_t* {aka long long unsigned int*}’
> > to ‘size_t* {aka unsigned int*}’
> > 
> > Signed-off-by: Alan Mikhak <amikhak@wirelessfabric.com>
> > ---
> >   kernel-shark/src/KsSession.cpp | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/kernel-shark/src/KsSession.cpp b/kernel-shark/src/KsSession.cpp
> > index 9d86776..a581bbf 100644
> > --- a/kernel-shark/src/KsSession.cpp
> > +++ b/kernel-shark/src/KsSession.cpp
> > @@ -450,7 +450,7 @@ void KsSession::saveDualMarker(KsDualMarkerSM *dm)
> >    */
> >   void KsSession::loadDualMarker(KsDualMarkerSM *dm, KsTraceGraph *graphs)
> >   {
> > -	uint64_t pos;
> > +	size_t pos;
> >   
> >   	dm->reset();
> >   	dm->setState(DualMarkerState::A);
> >   
> 
> 
> Hi Alan,
> Thanks a lot for this fix!
> 
> Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>
> 

Thanks Alan and Yordan.

I queued this patch for my next push to the repo (currently working on
some other things before I do that push).

-- Steve
Alan Mikhak June 12, 2019, 3:22 p.m. UTC | #5
On Wed, Jun 12, 2019 at 12:34 AM Yordan Karadzhov <ykaradzhov@vmware.com> wrote:
> On 12.06.19 г. 6:59 ч., Alan Mikhak wrote:
> > Fix compiler error at KsSession.cpp:457:30 on Raspberry Pi 3
::
> I am really curious to know how does KernelShark look and feel on
> Raspberry Pi. Would you shared with us your impressions.
> Honestly, I will be surprised if everything works fine ;)
>

Hi Yordan,

KernelShark launches on my Raspberry Pi 3 model B+, loads my trace
file, renders the screen elements, and is responsive. I have enabled a
swap file and GPU acceleration with extra memory for the GPU. From
looking at the code, rendering may even work on the CPU without
acceleration, but haven't tried it.

The abort issue on libkshark-model.c:242 currently limits KernelShark
on my Raspberry Pi 3 model B+:
https://bugzilla.kernel.org/show_bug.cgi?id=203869

Regards,
Alan
Alan Mikhak June 12, 2019, 3:31 p.m. UTC | #6
On Wed, Jun 12, 2019 at 5:12 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Wed, 12 Jun 2019 07:34:35 +0000
> Yordan Karadzhov <ykaradzhov@vmware.com> wrote:
>
> > On 12.06.19 г. 6:59 ч., Alan Mikhak wrote:
> > > Fix compiler error at KsSession.cpp:457:30 on Raspberry Pi 3
> > >
> > > Fix by changing the type of local variable 'pos' from uint64_t to
> > > size_t in KsSession::loadDualMarker().
> > >
> > > KsSession.cpp:457:30: error: no matching function for call to
> > > ‘KsSession::_getMarker(const char [6], uint64_t*)’
> > >    if (_getMarker("markA", &pos)) {
> > >                                ^
> > > In file included from KsSession.cpp:14:0:
> > > KsSession.hpp:97:7: note: candidate:
> > >   bool KsSession::_getMarker(const char*, size_t*)
> > >    bool _getMarker(const char* name, size_t *pos);
> > >         ^~~~~~~~~~
> > > KsSession.hpp:97:7: note:   no known conversion for
> > > argument 2 from ‘uint64_t* {aka long long unsigned int*}’
> > > to ‘size_t* {aka unsigned int*}’
> > >
> > > Signed-off-by: Alan Mikhak <amikhak@wirelessfabric.com>
> > > ---
> > >   kernel-shark/src/KsSession.cpp | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/kernel-shark/src/KsSession.cpp b/kernel-shark/src/KsSession.cpp
> > > index 9d86776..a581bbf 100644
> > > --- a/kernel-shark/src/KsSession.cpp
> > > +++ b/kernel-shark/src/KsSession.cpp
> > > @@ -450,7 +450,7 @@ void KsSession::saveDualMarker(KsDualMarkerSM *dm)
> > >    */
> > >   void KsSession::loadDualMarker(KsDualMarkerSM *dm, KsTraceGraph *graphs)
> > >   {
> > > -   uint64_t pos;
> > > +   size_t pos;
> > >
> > >     dm->reset();
> > >     dm->setState(DualMarkerState::A);
> > >
> >
> >
> > Hi Alan,
> > Thanks a lot for this fix!
> >
> > Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>
> >
>
> Thanks Alan and Yordan.
>
> I queued this patch for my next push to the repo (currently working on
> some other things before I do that push).
>
> -- Steve

Hi Steve and Yordan,

FYI, I ran the kernel get_maintainers.pl script when preparing this
patch but the script didn't suggest linux-trace-devel@vger.kernel.org
or either of you as maintainers.

Regards,
Alan
Steven Rostedt June 12, 2019, 3:53 p.m. UTC | #7
On Wed, 12 Jun 2019 08:31:30 -0700
Alan Mikhak <alanmikhak@gmail.com> wrote:

> Hi Steve and Yordan,
> 
> FYI, I ran the kernel get_maintainers.pl script when preparing this
> patch but the script didn't suggest linux-trace-devel@vger.kernel.org
> or either of you as maintainers.

Hi Alan,

Heh, that script is made to work with the Linux kernel. I never thought
about trying it against the trace-cmd.git repo. I may be able to make
that work, it shouldn't be too hard. I just need to create a
MAINTAINERS file.

I do have both: trace-cmd.org and kernelshark.org, that should show how
to submit patches.

Thanks!

-- Steve
Alan Mikhak June 14, 2019, 4:40 a.m. UTC | #8
On Wed, Jun 12, 2019 at 8:22 AM Alan Mikhak <alanmikhak@gmail.com> wrote:
>
> On Wed, Jun 12, 2019 at 12:34 AM Yordan Karadzhov <ykaradzhov@vmware.com> wrote:
> > On 12.06.19 г. 6:59 ч., Alan Mikhak wrote:
> > > Fix compiler error at KsSession.cpp:457:30 on Raspberry Pi 3
> ::
> > I am really curious to know how does KernelShark look and feel on
> > Raspberry Pi. Would you shared with us your impressions.
> > Honestly, I will be surprised if everything works fine ;)
> >
>
> Hi Yordan,
>
> KernelShark launches on my Raspberry Pi 3 model B+, loads my trace
> file, renders the screen elements, and is responsive. I have enabled a
> swap file and GPU acceleration with extra memory for the GPU. From
> looking at the code, rendering may even work on the CPU without
> acceleration, but haven't tried it.
>
> The abort issue on libkshark-model.c:242 currently limits KernelShark
> on my Raspberry Pi 3 model B+:
> https://bugzilla.kernel.org/show_bug.cgi?id=203869

Hi Yorday,

I installed trace-cmd and kernelshark on my Raspberry Pi 3 model B+
using the following command:

$ sudo apt install trace-cmd kernelshark

The version of kernelshark installed by 'apt install' runs smoothly on
my Raspberry Pi 3 model B+ and doesn't exhibit the abort issue I
reported here about the version I built from sources.

Regards,
Alan

Patch
diff mbox series

diff --git a/kernel-shark/src/KsSession.cpp b/kernel-shark/src/KsSession.cpp
index 9d86776..a581bbf 100644
--- a/kernel-shark/src/KsSession.cpp
+++ b/kernel-shark/src/KsSession.cpp
@@ -450,7 +450,7 @@  void KsSession::saveDualMarker(KsDualMarkerSM *dm)
  */
 void KsSession::loadDualMarker(KsDualMarkerSM *dm, KsTraceGraph *graphs)
 {
-	uint64_t pos;
+	size_t pos;
 
 	dm->reset();
 	dm->setState(DualMarkerState::A);