[LCA2019 Chat] ftrace prep

duncan_roe at optusnet.com.au duncan_roe at optusnet.com.au
Wed Jan 23 07:37:13 AEDT 2019


Hi Thomas,

On Wed, Jan 23, 2019 at 08:03:00AM +1300, Thomas Sprinkmeier wrote:
> Hi any/all,
> 
> If you're not going to the ftrace prep then please return to your
> regularly scheduled programming .... now.
> 
> https://linux.conf.au/schedule/presentation/130/
> 
> I added a few minor tweaks to get it to (mostly) build on my system
> (debian 9.6):
> 
> 
> 0 0 sprinkmeier at denovo:~/GIT/LCA2019/trace-cmd$ git diff
> diff --git a/Makefile b/Makefile
> index f0f7e92..a5db6e8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -204,6 +204,9 @@ CFLAGS ?= -g -Wall
>  CPPFLAGS ?=
>  LDFLAGS ?=
>  
> +# TS
> +CFLAGS   += -fPIC
> +
>  export CFLAGS
>  export INCLUDES
>  
> diff --git a/kernel-shark/CMakeLists.txt
b/kernel-shark/CMakeLists.txt
> index 9460026..8a807a6 100644
> --- a/kernel-shark/CMakeLists.txt
> +++ b/kernel-shark/CMakeLists.txt
> @@ -36,8 +36,8 @@ endif (Qt5Widgets_FOUND)
>  set(LIBRARY_OUTPUT_PATH    "${KS_DIR}/lib")
>  set(EXECUTABLE_OUTPUT_PATH "${KS_DIR}/bin")
>  
> -set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -Wall -g -pthread")
> -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g -std=c++11
-pthread")
> +set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -Wall -g -pthread -fPIC")
> +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g -std=c++11
-pthread
> -fPIC") 
>  if (NOT _DEBUG)
>  
> diff --git a/kernel-shark/src/libkshark.c
b/kernel-shark/src/libkshark.c
> index 5033e47..585d415 100644
> --- a/kernel-shark/src/libkshark.c
> +++ b/kernel-shark/src/libkshark.c
> @@ -692,8 +692,8 @@ static size_t get_records(struct kshark_context
> *kshark_ctx, struct rec_list *temp_rec;
>         size_t count, total = 0;
>         int n_cpus;
> -       int pid;
> -       int cpu;
> +       int pid = -1;
> +       int cpu = -1;
>  
>         n_cpus = tracecmd_cpus(kshark_ctx->handle);
>         cpu_list = calloc(n_cpus, sizeof(*cpu_list));
> 0 0 sprinkmeier at denovo:~/GIT/LCA2019/trace-cmd$ 
> 
> 
> 
> 
> I now get as far as
> 
> 
> 
> 0 0 sprinkmeier at denovo:~/GIT/LCA2019/trace-cmd$ make gui
> make[1]:
>
'/home/sprinkmeier/GIT/LCA2019/trace-cmd/lib/traceevent/libtraceevent.a'
> is up to date. make[1]:
>
'/home/sprinkmeier/GIT/LCA2019/trace-cmd/lib/trace-cmd/libtracecmd.a'
> is up to date.
> 
>     NO_PYTHON forced: swig not installed, not compiling python
plugins
> 
> [ 25%] Built target kshark
> [ 37%] Built target sched_events
> [ 50%] Built target missed_events
> [ 58%] Built target dhisto
> [ 66%] Built target dfilter
> [ 75%] Built target dload
> [ 79%] Linking CXX executable ../../bin/dplot
> /usr/bin/ld: cannot find -lkshark-plot
> collect2: error: ld returned 1 exit status
> examples/CMakeFiles/dplot.dir/build.make:94: recipe for target
> '../bin/dplot' failed make[3]: *** [../bin/dplot] Error 1
> CMakeFiles/Makefile2:357: recipe for target
> 'examples/CMakeFiles/dplot.dir/all' failed make[2]: ***
> [examples/CMakeFiles/dplot.dir/all] Error 2 Makefile:127: recipe for
> target 'all' failed make[1]: *** [all] Error 2
> Makefile:263: recipe for target 'gui' failed
> make: *** [gui] Error 2
> 2 0 sprinkmeier at denovo:~/GIT/LCA2019/trace-cmd$ 
> 
> 
> 
> 
> My first reaction is 
> "this is an IQ test to see if you're worthy to attend, and I
FAILED!"
> my second reaction is
> "It's a GUI, how important can it be???"
> 
> 
> I assume reality lies somewhere in between these extremes.
> If someone can point me in the direction of the nearest convenient
> reality I'd appreciate it.
> 
> 
> Thomas
> 
It built for me with just this patch (I ignored the warnings - thanks
for those patches):

> --- a/Makefile
> +++ b/Makefile
> @@ -200,7 +200,7 @@ INCLUDES += -I$(obj)/tracecmd/include
>  include $(src)/features.mk
>  
>  # Set compile option CFLAGS if not set elsewhere
> -CFLAGS ?= -g -Wall
> +CFLAGS ?= -g -Wall -fPIC
>  CPPFLAGS ?=
>  LDFLAGS ?=
>  
(last line has trlg space)

But ... I have swig installed. It's not mentioned as a dependency in
kernel-shark/README but it seems to be one.

I would install swig and try again. Good luck,

Cheers ... Duncan

-------------------------
Email sent using Optus Webmail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lca2019.linux.org.au/pipermail/chat/attachments/20190123/2054194f/attachment-0001.html>


More information about the Chat mailing list