Skip to contentSkip to conversation

Fix compiler error in KsSession.cpp on Raspberry Pi 3

PATCH In review Alan Mikhak 3 participants 9 messages Jun 12, 2019 – Jun 14, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compiler error in KsSession.cpp on Raspberry Pi 3

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*}’

---
 kernel-shark/src/KsSession.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel-shark/src/KsSession.cpp +1 -1
index 9d86776..a581bbf 100644
@@ -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);
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Alan Mikhak

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*}’

---
  kernel-shark/src/KsSession.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
kernel-shark/src/KsSession.cpp +0 -0
index 9d86776..a581bbf 100644

kernel-shark/src/KsSession.cpp void KsSession::saveDualMarker(KsDualMarkerSM *dm) · line 456

Quoted 8 lines
kernel-shark/src/KsSession.cpp +1 -1
@@ -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!

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

#2 lore raw
Quoted 43 lines · On Wed, 12 Jun 2019 07:34:35 +0000 Yordan Karadzhov <[email protected]>…
Quoted 29 lines · Alan Mikhak

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*}’

---
  kernel-shark/src/KsSession.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
kernel-shark/src/KsSession.cpp +0 -0
index 9d86776..a581bbf 100644

kernel-shark/src/KsSession.cpp void KsSession::saveDualMarker(KsDualMarkerSM *dm) · line 456

Quoted 8 lines
kernel-shark/src/KsSession.cpp +1 -1
@@ -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!

Quoted 2 lines

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

#3 lore raw
Quoted 50 lines · Steven Rostedt
Quoted 43 lines · On Wed, 12 Jun 2019 07:34:35 +0000 Yordan Karadzhov <[email protected]>…
Quoted 29 lines · Alan Mikhak

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*}’

---
  kernel-shark/src/KsSession.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
kernel-shark/src/KsSession.cpp +0 -0
index 9d86776..a581bbf 100644

kernel-shark/src/KsSession.cpp void KsSession::saveDualMarker(KsDualMarkerSM *dm) · line 456

Quoted 8 lines
kernel-shark/src/KsSession.cpp +1 -1
@@ -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!

Quoted 2 lines
Quoted 6 lines

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 [email protected] or either of you as maintainers.

Regards,
Alan

#4 lore raw
Quoted 5 lines · On Wed, 12 Jun 2019 08:31:30 -0700 Alan Mikhak <[email protected]> wrote:

Hi Steve and Yordan,

FYI, I ran the kernel get_maintainers.pl script when preparing this patch but the script didn't suggest [email protected] 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

#5 lore raw
In reply to Yordan Karadzhov
Quoted 2 lines · Yordan Karadzhov
Quoted 1 line · Alan Mikhak

Fix compiler error at KsSession.cpp:457:30 on Raspberry Pi 3

::

Quoted 4 lines

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

#6 lore raw
Quoted 18 lines · Alan Mikhak
Quoted 2 lines · Yordan Karadzhov
Quoted 1 line · Alan Mikhak

Fix compiler error at KsSession.cpp:457:30 on Raspberry Pi 3

::

Quoted 4 lines

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.

Quoted 3 lines

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

#7 lore raw
In reply to Alan Mikhak

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

#8 lore raw
Quoted 7 lines · On Wed, 12 Jun 2019 08:17:38 +0000 Yordan Karadzhov <[email protected]>…

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/

Quoted 8 lines

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