Giter Club home page Giter Club logo

gpuvis's People

Contributors

1ace avatar adamnv avatar alexdeucher avatar asgeir avatar bkaradzic avatar bobbeckett avatar counterpillow avatar elect86 avatar elee29 avatar emantor avatar emersion avatar flibitijibibo avatar jadwallis avatar jawilkins avatar jbeich avatar llandwerlin-intel avatar lostgoat avatar mikesart avatar mikesartain avatar ocornut avatar panosk92 avatar pdoane-blizzard avatar plagman avatar randygaul avatar romangg avatar shwnchpl avatar thedmd avatar ttimo avatar unerlige avatar waywardmonkeys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gpuvis's Issues

Patch to allow building on macOS

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 515741b..2e49e56 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,15 +40,20 @@ ucm_set_runtime( STATIC )
 ucm_add_flags( -O0 -DDEBUG CONFIG Debug )
 ucm_add_flags( -O2 -DNDEBUG CONFIG Release )
 
-if ( CMAKE_COMPILER_IS_GNUCC )
+if ( CMAKE_COMPILER_IS_GNUCC OR APPLE )
     ucm_add_flags( CXX -std=c++11 )
 endif()
 
+if ( APPLE )
+    ucm_add_flags( CXX -stdlib=libc++ )
+    ucm_add_linker_flags( -stdlib=libc++ )
+endif()
+
 if ( WIN32 )
     ucm_add_flags( -D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4244 /wd4090 /wd4018 /wd4267 )
 
     LINK_LIBRARIES( shlwapi opengl32 comctl32 )
-elseif ( UNIX )
+elseif ( UNIX AND NOT APPLE )
     find_package( PkgConfig REQUIRED )
     pkg_check_modules( GTK3 REQUIRED gtk+-3.0 )
 
@@ -82,6 +87,10 @@ set ( SRC_LIST
     src/trace-cmd/trace-read.cpp
     )
 
+if ( APPLE )
+    list ( APPEND SRC_LIST src/noc_file_dialog_osx.mm )
+endif()
+
 include_directories(
     ${CMAKE_CURRENT_LIST_DIR}/src
     ${FREETYPE_INCLUDE_DIRS}
diff --git a/src/gpuvis.cpp b/src/gpuvis.cpp
index 4b91673..3d06a26 100644
--- a/src/gpuvis.cpp
+++ b/src/gpuvis.cpp
@@ -52,7 +52,10 @@
 #include "miniz.h"
 
 // https://github.com/ocornut/imgui/issues/88
-#if defined( USE_GTK3 )
+#if defined( __APPLE__ )
+  #define NOC_FILE_DIALOG_IMPLEMENTATION
+  #define NOC_FILE_DIALOG_OSX
+  #include "noc_file_dialog.h"
+#elif defined( USE_GTK3 )
   #define NOC_FILE_DIALOG_IMPLEMENTATION
   #define NOC_FILE_DIALOG_GTK
   #include "noc_file_dialog.h"
diff --git a/src/gpuvis_framemarkers.cpp b/src/gpuvis_framemarkers.cpp
index c84c5b3..b3326e9 100644
--- a/src/gpuvis_framemarkers.cpp
+++ b/src/gpuvis_framemarkers.cpp
@@ -29,6 +29,7 @@
 #include <algorithm>
 #include <unordered_map>
 #include <functional>
+#include <string>
 
 #include <SDL.h>
 
diff --git a/src/gpuvis_graph.cpp b/src/gpuvis_graph.cpp
index 496a1b1..36de216 100644
--- a/src/gpuvis_graph.cpp
+++ b/src/gpuvis_graph.cpp
@@ -29,6 +29,7 @@
 #include <algorithm>
 #include <functional>
 #include <unordered_map>
+#include <string>
 
 #include <SDL.h>
 
diff --git a/src/gpuvis_graphrows.cpp b/src/gpuvis_graphrows.cpp
index 3eb59a6..1dfdd6b 100644
--- a/src/gpuvis_graphrows.cpp
+++ b/src/gpuvis_graphrows.cpp
@@ -29,6 +29,7 @@
 #include <algorithm>
 #include <unordered_map>
 #include <functional>
+#include <string>
 
 #include <SDL.h>
 
diff --git a/src/gpuvis_plots.cpp b/src/gpuvis_plots.cpp
index dc72f41..da4ef35 100644
--- a/src/gpuvis_plots.cpp
+++ b/src/gpuvis_plots.cpp
@@ -29,6 +29,7 @@
 #include <functional>
 #include <algorithm>
 #include <unordered_map>
+#include <string>
 
 #include <SDL.h>
 
diff --git a/src/gpuvis_utils.cpp b/src/gpuvis_utils.cpp
index 348a14d..c4ffa4a 100644
--- a/src/gpuvis_utils.cpp
+++ b/src/gpuvis_utils.cpp
@@ -26,6 +26,17 @@
 
 #ifndef WIN32
 #include <unistd.h>
+// https://android.googlesource.com/platform/system/core/+/master/base/include/android-base/macros.h
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(exp)            \
+  ({                                       \
+    decltype(exp) _rc;                     \
+    do {                                   \
+      _rc = (exp);                         \
+    } while (_rc == -1 && errno == EINTR); \
+    _rc;                                   \
+  })
+#endif
 #else
 #define WIN32_LEAN_AND_MEAN 1
 #include <windows.h>
diff --git a/src/noc_file_dialog.h b/src/noc_file_dialog.h
index 4bd5f8c..b8fa683 100644
--- a/src/noc_file_dialog.h
+++ b/src/noc_file_dialog.h
@@ -185,74 +185,7 @@ const char *noc_file_dialog_open(int flags,
 
 #elif defined( NOC_FILE_DIALOG_OSX )
 
-#include <AppKit/AppKit.h>
-
-const char *noc_file_dialog_open(int flags,
-                                 const char *filters,
-                                 const char *default_path,
-                                 const char *default_name)
-{
-    NSURL *url;
-    const char *utf8_path;
-    NSSavePanel *panel;
-    NSOpenPanel *open_panel;
-    NSMutableArray *types_array;
-    NSURL *default_url;
-    char buf[128], *patterns;
-    // XXX: I don't know about memory management with cococa, need to check
-    // if I leak memory here.
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    if (flags & NOC_FILE_DIALOG_OPEN) {
-        panel = open_panel = [NSOpenPanel openPanel];
-    } else {
-        panel = [NSSavePanel savePanel];
-    }
-
-    if (flags & NOC_FILE_DIALOG_DIR) {
-        [open_panel setCanChooseDirectories:YES];
-        [open_panel setCanChooseFiles:NO];
-    }
-
-    if (default_path) {
-        default_url = [NSURL fileURLWithPath:
-            [NSString stringWithUTF8String:default_path]];
-        [panel setDirectoryURL:default_url];
-        [panel setNameFieldStringValue:default_url.lastPathComponent];
-    }
-
-    if (filters) {
-        types_array = [NSMutableArray array];
-        while (*filters) {
-            filters += strlen(filters) + 1; // skip the name
-            // Split the filter pattern with ';'.
-            strcpy(buf, filters);
-            buf[strlen(buf) + 1] = '\0';
-            for (patterns = buf; *patterns; patterns++)
-                if (*patterns == ';') *patterns = '\0';
-            patterns = buf;
-            while (*patterns) {
-                assert(strncmp(patterns, "*.", 2) == 0);
-                patterns += 2; // Skip the "*."
-                [types_array addObject:[NSString stringWithUTF8String: patterns]];
-                patterns += strlen(patterns) + 1;
-            }
-            filters += strlen(filters) + 1;
-        }
-        [panel setAllowedFileTypes:types_array];
-    }
-
-    free(g_noc_file_dialog_ret);
-    g_noc_file_dialog_ret = NULL;
-    if ( [panel runModal] == NSModalResponseOK ) {
-        url = [panel URL];
-        utf8_path = [[url path] UTF8String];
-        g_noc_file_dialog_ret = strdup(utf8_path);
-    }
-
-    [pool release];
-    return g_noc_file_dialog_ret;
-}
+// moved to noc_file_dialog_osx.mm
 
 #else
 
diff --git a/src/noc_file_dialog_osx.mm b/src/noc_file_dialog_osx.mm
new file mode 100644
index 0000000..04b0722
--- /dev/null
+++ b/src/noc_file_dialog_osx.mm
@@ -0,0 +1,72 @@
+#define NOC_FILE_DIALOG_IMPLEMENTATION
+#define NOC_FILE_DIALOG_OSX
+#include "noc_file_dialog.h"
+
+#include <AppKit/AppKit.h>
+
+const char *noc_file_dialog_open(int flags,
+                                 const char *filters,
+                                 const char *default_path,
+                                 const char *default_name)
+{
+    NSURL *url;
+    const char *utf8_path;
+    NSSavePanel *panel;
+    NSOpenPanel *open_panel;
+    NSMutableArray *types_array;
+    NSURL *default_url;
+    char buf[128], *patterns;
+    // XXX: I don't know about memory management with cococa, need to check
+    // if I leak memory here.
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+    if (flags & NOC_FILE_DIALOG_OPEN) {
+        panel = open_panel = [NSOpenPanel openPanel];
+    } else {
+        panel = [NSSavePanel savePanel];
+    }
+
+    if (flags & NOC_FILE_DIALOG_DIR) {
+        [open_panel setCanChooseDirectories:YES];
+        [open_panel setCanChooseFiles:NO];
+    }
+
+    if (default_path) {
+        default_url = [NSURL fileURLWithPath:
+            [NSString stringWithUTF8String:default_path]];
+        [panel setDirectoryURL:default_url];
+        [panel setNameFieldStringValue:default_url.lastPathComponent];
+    }
+
+    if (filters) {
+        types_array = [NSMutableArray array];
+        while (*filters) {
+            filters += strlen(filters) + 1; // skip the name
+            // Split the filter pattern with ';'.
+            strcpy(buf, filters);
+            buf[strlen(buf) + 1] = '\0';
+            for (patterns = buf; *patterns; patterns++)
+                if (*patterns == ';') *patterns = '\0';
+            patterns = buf;
+            while (*patterns) {
+                assert(strncmp(patterns, "*.", 2) == 0);
+                patterns += 2; // Skip the "*."
+                [types_array addObject:[NSString stringWithUTF8String: patterns]];
+                patterns += strlen(patterns) + 1;
+            }
+            filters += strlen(filters) + 1;
+        }
+        [panel setAllowedFileTypes:types_array];
+    }
+
+    free(g_noc_file_dialog_ret);
+    g_noc_file_dialog_ret = NULL;
+    if ( [panel runModal] == NSModalResponseOK ) {
+        url = [panel URL];
+        utf8_path = [[url path] UTF8String];
+        g_noc_file_dialog_ret = strdup(utf8_path);
+    }
+
+    [pool release];
+    return g_noc_file_dialog_ret;
+}
diff --git a/src/tdopexpr.cpp b/src/tdopexpr.cpp
index 1cc9e89..9b8c8ea 100644
--- a/src/tdopexpr.cpp
+++ b/src/tdopexpr.cpp
@@ -30,6 +30,7 @@
 #include <algorithm>
 #include <vector>
 #include <unordered_map>
+#include <string>
 
 #include "tdopexpr.h"
 #include "gpuvis_macros.h"
diff --git a/src/trace-cmd/event-parse.c b/src/trace-cmd/event-parse.c
index 51e2e1d..0c9cdd4 100644
--- a/src/trace-cmd/event-parse.c
+++ b/src/trace-cmd/event-parse.c
@@ -44,7 +44,12 @@
 #pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
 #endif
 
-#ifndef WIN32
+#ifdef __APPLE__
+#include <sys/socket.h>
+#include <netinet/in.h>
+#define	s6_addr16   __u6_addr.__u6_addr16
+#define	s6_addr32   __u6_addr.__u6_addr32
+#elif !defined(WIN32)
 #include <netinet/ip6.h>
 #else
 #define __func__ __FUNCTION__
diff --git a/src/trace-cmd/trace-read.cpp b/src/trace-cmd/trace-read.cpp
index 9c9b440..f50e010 100644
--- a/src/trace-cmd/trace-read.cpp
+++ b/src/trace-cmd/trace-read.cpp
@@ -46,6 +46,23 @@
 #include <sys/mman.h>
 #include <sys/param.h>
 #include <unistd.h>
+
+#ifdef __APPLE__
+#define lseek64 lseek
+#define off64_t off_t
+#endif
+
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(exp)            \
+  ({                                       \
+    decltype(exp) _rc;                     \
+    do {                                   \
+      _rc = (exp);                         \
+    } while (_rc == -1 && errno == EINTR); \
+    _rc;                                   \
+  })
+#endif
+
 #endif
 
 extern "C"

Not getting vblank events for NVIDIA (Is this expected?)

As titled.

What I've tried so far is:

  • The first time I tried this was without the DRM kernel mode setting for NVIDIA enabled, so I figured turning it on might fix this (with options nvidia_drm modeset=1 in /etc/modprobe.d/nvidia-drm.conf. lsmod seems to confirm that all the relevant modules* are loaded, except for nvidia_uvm - and ttm that MHWD blacklists for some reason. I haven't tried turning them on yet, as I don't quite see why they would affect this). Unfortunately, I'm still getting nothing back for drm:drm_vblank_event and running trace-cmd report trace.dat | grep drm confirms that it's not tracing those events

* Specifically, I mean drm, drm_kms_helper, nvidia, nvidia_drm, and nvidia_modeset as reported by lsmod | grep nvidia.

  • Searched around the issues here, and thought my case might be similar to #48 - as in trace-cmd being the problem, so I went and compiled it myself. Unfortunately, nothing seems to have changed.
  • I'll note that trace-cmd list | grep drm seems to show that the drm_vblank_event, drm_vblank_queued and drm_vblank_event_delivered are traceable.

Does tracing DRM events simply not work for NVIDIA? (had a hard time finding anything relevant via Google) It seems quite odd if this is the case, since it appears that this should be coming from the kernel. Or are there other things that I should be turning on (DRM-related) for this to work?

(By-the-way, I'm using Manjaro - which may/may not have anything to do with this. MHWD did botch upgrading NVIDIA drivers several times in the past, which I seem to have 'fixed' - as in I can use everything fine, to my eyes - by manually installing/uninstalling using a mix of pacman and mhwd on the virtual terminal. As to kernel/drivers/hardware, I'm on kernel 4.19, NVIDIA 460.39 drivers with an RTX 2080)

No vblank markers on AMD Navi 10

I'm running an AMD RX 5700 (Navi 10) and in the output no vblank markers are shown.

Checkbox Show crtc0 markers (~16.67ms) is selected.

On Intel they are shown.

I assume the AMD kernel driver just does not provide these events? Or is there a different issue?

gpuvis Application icon

as part of RPM and flatpak integration packaging requirements for desktop applications; Gpuvis needs an Icon.
do you have any suggestions for icon that you'd prefer to use when searching for gpuvis app on the desktop?
here's an Icon suggestion attached
com github gpuvis Gpuvis

Crash as soon as a trace.dat file is read

Using it on Plasma Wayland, not sure if it could make a difference.

Here's the example file:
https://proli.net/meu/plasma-boot/trace.dat

That's the pretty much useless backtrace it leaves behind:

#0  0x00007f725e1f4c87 in __strlen_avx2 () at /usr/lib/libc.so.6
#1  0x00007f725e10055e in __vfprintf_internal () at /usr/lib/libc.so.6
#2  0x00007f725e111895 in __vasprintf_internal () at /usr/lib/libc.so.6
#3  0x000055ad94c9ccda in logf(char const*, ...) ()
#4  0x000055ad94d1b0ab in  ()
#5  0x000055ad94d1d3c5 in read_trace_file(char const*, StrPool&, trace_info_t&, std::function<int (trace_event_t const&)>&) ()
#6  0x000055ad94c61225 in MainApp::thread_func(void*) ()
#7  0x00007f725e4f688f in  () at /usr/lib/libSDL2-2.0.so.0
#8  0x00007f725e57eefa in  () at /usr/lib/libSDL2-2.0.so.0
#9  0x00007f725e47657f in start_thread () at /usr/lib/libpthread.so.0
#10 0x00007f725e1920e3 in clone () at /usr/lib/libc.so.6

Any idea what could be going on?

On SteamOS, gpuvis failed to visualize the captured trace file.

On SteamOS,

  1. Use the sample scripts at folder ./gpuvis/sample to capture a event trace.
    $ sudo ./trace-cmd-setup.sh
    $ sudo ./trace-cmd-start-tracing.sh
    $ sudo ./trace-cmd-capture.sh
    $ sudo ./trace-cmd-stop-tracing.sh
    Then a file named trace_02-02-2023_13-20-27.dat is created

  2. Use gpuvis application to visualize.
    $ gpuvis trace_02-02-2023_13-20-27.dat

It failed with errors shown as below.
image

[Error] read_header_files: header_page not found.
[Error] read_trace_file: setjmp error called for trace_02-02-2023_13-20-27.dat
[Error] load_trace_file(trace_02-02-2023_13-20-27.dat) failed.

Is there anybody experienced this error?

It is deeply appreciated for any suggestions.

Build requires static libstdc++

Minor thing but the current git fails to build if static libstdc++ isn't installed, though it fails to detect / warn about it.

[build01@localhost build]$ cmake ..
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /bin/c++
-- Check for working CXX compiler: /bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
<FindSDL2.cmake>
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
</FindSDL2.cmake>
-- Found SDL2: /usr/lib64/libSDL2.so;-lpthread  
-- Found Freetype: /usr/lib64/libfreetype.so (found version "2.4.11") 
-- Found PkgConfig: /bin/pkg-config (found version "0.27.1") 
-- Checking for module 'gtk+-3.0'
--   Found gtk+-3.0, version 3.22.10

CMAKE_C_FLAGS:  -DUSE_FREETYPE -static-libstdc++ -static-libgcc -DUSE_GTK3 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64
CMAKE_CXX_FLAGS:  -DUSE_FREETYPE -static-libstdc++ -static-libgcc -std=c++11 -DUSE_GTK3 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64
CMAKE_EXE_LINKER_FLAGS: 
CMAKE_MODULE_LINKER_FLAGS: 
CMAKE_SHARED_LINKER_FLAGS: 
CMAKE_STATIC_LINKER_FLAGS: 

-- Configuring done
-- Generating done
-- Build files have been written to: /dev/shm/git/gpuvis/build
[build01@localhost build]$ make -j
Scanning dependencies of target gpuvis
[  8%] Building CXX object CMakeFiles/gpuvis.dir/src/gpuvis_plots.cpp.o
[  8%] Building CXX object CMakeFiles/gpuvis.dir/src/gpuvis_graphrows.cpp.o
[ 13%] Building CXX object CMakeFiles/gpuvis.dir/src/gpuvis_graph.cpp.o
[ 21%] Building CXX object CMakeFiles/gpuvis.dir/src/gpuvis.cpp.o
[ 69%] Building CXX object CMakeFiles/gpuvis.dir/src/tdopexpr.cpp.o
[ 60%] Building CXX object CMakeFiles/gpuvis.dir/src/gpuvis_framemarkers.cpp.o
[ 69%] Building C object CMakeFiles/gpuvis.dir/src/ya_getopt.c.o
[ 69%] Building CXX object CMakeFiles/gpuvis.dir/src/gpuvis_ftrace_print.cpp.o
[ 69%] Building CXX object CMakeFiles/gpuvis.dir/src/imgui/imgui_demo.cpp.o
[ 69%] Building C object CMakeFiles/gpuvis.dir/src/miniz.c.o
[ 69%] Building CXX object CMakeFiles/gpuvis.dir/src/gpuvis_utils.cpp.o
[ 69%] Building CXX object CMakeFiles/gpuvis.dir/src/stlini.cpp.o
[ 69%] Building CXX object CMakeFiles/gpuvis.dir/src/imgui/imgui_draw.cpp.o
[ 69%] Building CXX object CMakeFiles/gpuvis.dir/src/MurmurHash3.cpp.o
[ 78%] Building C object CMakeFiles/gpuvis.dir/src/GL/gl3w.c.o
[ 69%] Building CXX object CMakeFiles/gpuvis.dir/src/imgui/imgui_impl_sdl_gl3.cpp.o
[ 78%] Building CXX object CMakeFiles/gpuvis.dir/src/imgui/imgui.cpp.o
[ 78%] Building CXX object CMakeFiles/gpuvis.dir/src/imgui/imgui_freetype.cpp.o
[ 82%] Building C object CMakeFiles/gpuvis.dir/src/trace-cmd/event-parse.c.o
[ 86%] Building C object CMakeFiles/gpuvis.dir/src/trace-cmd/trace-seq.c.o
[ 91%] Building C object CMakeFiles/gpuvis.dir/src/trace-cmd/kbuffer-parse.c.o
[ 95%] Building CXX object CMakeFiles/gpuvis.dir/src/trace-cmd/trace-read.cpp.o
/dev/shm/git/gpuvis/src/trace-cmd/event-parse.c:42:9: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wint-conversion"
         ^
/dev/shm/git/gpuvis/src/MurmurHash3.cpp:35:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
 #pragma GCC diagnostic warning "-Wimplicit-fallthrough=0"
                                ^

[100%] Linking CXX executable gpuvis
/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
make[2]: *** [gpuvis] Error 1
make[1]: *** [CMakeFiles/gpuvis.dir/all] Error 2
make: *** [all] Error 2
[build01@localhost build]$ 
[build01@localhost build]$ rpm -qa |grep -i stdc++
libstdc++-4.8.5-16.el7_4.2.i686
libstdc++-4.8.5-16.el7_4.2.x86_64
libstdc++-devel-4.8.5-16.el7_4.2.x86_64
[build01@localhost build]$ ls
CMakeCache.txt  CMakeFiles  cmake_install.cmake  Makefile
[build01@localhost build]$ lynx ..


Exiting via interrupt: 2

[build01@localhost build]$ grep -r stdc++ .
Binary file ./CMakeFiles/feature_tests.bin matches
./CMakeFiles/gpuvis.dir/link.txt:/bin/c++    -DUSE_FREETYPE -static-libstdc++ -static-libgcc -std=c++11 -DUSE_GTK3 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64   CMakeFiles/gpuvis.dir/src/gpuvis.cpp.o CMakeFiles/gpuvis.dir/src/gpuvis_graph.cpp.o CMakeFiles/gpuvis.dir/src/gpuvis_framemarkers.cpp.o CMakeFiles/gpuvis.dir/src/gpuvis_plots.cpp.o CMakeFiles/gpuvis.dir/src/gpuvis_graphrows.cpp.o CMakeFiles/gpuvis.dir/src/gpuvis_ftrace_print.cpp.o CMakeFiles/gpuvis.dir/src/gpuvis_utils.cpp.o CMakeFiles/gpuvis.dir/src/tdopexpr.cpp.o CMakeFiles/gpuvis.dir/src/ya_getopt.c.o CMakeFiles/gpuvis.dir/src/MurmurHash3.cpp.o CMakeFiles/gpuvis.dir/src/miniz.c.o CMakeFiles/gpuvis.dir/src/stlini.cpp.o CMakeFiles/gpuvis.dir/src/imgui/imgui_impl_sdl_gl3.cpp.o CMakeFiles/gpuvis.dir/src/imgui/imgui.cpp.o CMakeFiles/gpuvis.dir/src/imgui/imgui_demo.cpp.o CMakeFiles/gpuvis.dir/src/imgui/imgui_draw.cpp.o CMakeFiles/gpuvis.dir/src/imgui/imgui_freetype.cpp.o CMakeFiles/gpuvis.dir/src/GL/gl3w.c.o CMakeFiles/gpuvis.dir/src/trace-cmd/event-parse.c.o CMakeFiles/gpuvis.dir/src/trace-cmd/trace-seq.c.o CMakeFiles/gpuvis.dir/src/trace-cmd/kbuffer-parse.c.o CMakeFiles/gpuvis.dir/src/trace-cmd/trace-read.cpp.o  -o gpuvis -rdynamic -ldl -lSDL2 -lpthread -lfreetype 
./CMakeFiles/gpuvis.dir/flags.make:C_FLAGS =  -DUSE_FREETYPE -static-libstdc++ -static-libgcc -DUSE_GTK3 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64  
./CMakeFiles/gpuvis.dir/flags.make:CXX_FLAGS =  -DUSE_FREETYPE -static-libstdc++ -static-libgcc -std=c++11 -DUSE_GTK3 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64  
Binary file ./CMakeFiles/3.6.3/CompilerIdCXX/a.out matches
./CMakeFiles/3.6.3/CMakeCXXCompiler.cmake:set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;c")
Binary file ./CMakeFiles/3.6.3/CMakeDetermineCompilerABI_CXX.bin matches
./CMakeFiles/CMakeOutput.log: /usr/libexec/gcc/x86_64-redhat-linux/4.8.5/collect2 --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_2b1bf /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.. CMakeFiles/cmTC_2b1bf.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o
./CMakeFiles/CMakeOutput.log:  link line: [ /usr/libexec/gcc/x86_64-redhat-linux/4.8.5/collect2 --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_2b1bf /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.. CMakeFiles/cmTC_2b1bf.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o]
./CMakeFiles/CMakeOutput.log:    arg [-lstdc++] ==> lib [stdc++]
./CMakeFiles/CMakeOutput.log:  implicit libs: [stdc++;m;c]
[build01@localhost build]$ make -j
[  4%] Linking CXX executable gpuvis
[100%] Built target gpuvis
[build01@localhost build]$ 
$ rpm -qa |grep -i stdc++
libstdc++-4.8.5-28.el7_5.1.i686
libstdc++-devel-4.8.5-28.el7_5.1.x86_64
libstdc++-static-4.8.5-28.el7_5.1.x86_64
libstdc++-4.8.5-28.el7_5.1.x86_64
[build01@localhost build]$ 

GCC 4.8.5 Build failure, different inttypes.h?

I get this with the latest git :

src/stlini.cpp: In member function ‘void CIniFile::PutUint64(const char*, uint64_t, const char*)’:
src/stlini.cpp:325:41: error: expected ‘)’ before ‘PRIx64’
snprintf( buf, sizeof( buf ), "0x%" PRIx64, value );

Not sure where the problem is (RH or porting?) but I couldn't build on gcc 4.8.5 / CentOS 7 without manually adding definitions for :

#define PRId64 "lld"
#define PRIx64 "llx"
#define PRIu64 "llu"
#define PRIo64 "llo"

to src/stlini.cpp

Including inttypes.h itself didn't work as they are defined differently.

/* The ISO C99 standard specifies that these macros must only be
   defined if explicitly requested.  */

#if !defined __cplusplus || defined __STDC_FORMAT_MACROS

# if __WORDSIZE == 64
#  define __PRI64_PREFIX        "l"
#  define __PRIPTR_PREFIX       "l"
# else
#  define __PRI64_PREFIX        "ll"
#  define __PRIPTR_PREFIX
# endif

# define PRIx64		__PRI64_PREFIX "x"

Scrolling behaviour is weird

I expected scrolling to pan the view instead of modifying the zoom.
It's especially important since the horizontal scrollbar gets outside the viewport rather easily.

trace-cmd-setup fails on i915/perf_stream_paranoid file not found

On master branch running trace-cmd-setup.sh the following error is reported:
sysctl: cannot stat /proc/sys/dev/i915/perf_stream_paranoid: No such file or directory

I tried to set USE_I915_PERF to 0 and 1.

Checking out one commit before 812c8a5 the script works again.

System is kernel 5.6.18-1-MANJARO, AMD GPU and Intel i7, KWinFT Wayland session.

Doesn't build with GCC 7.1

I first tried the included Makefile, then generating it from the cmake. You can see the log of that below. It looks like you're not telling the compiler to use the right -std= or something?

✓ fratti@archbook gpuvis $ make -j4
Building _release/gpuvis...
---- src/gpuvis.cpp ----
---- src/gpuvis_graph.cpp ----
---- src/gpuvis_utils.cpp ----
---- src/tdopexpr.cpp ----
In file included from src/gpuvis_graph.cpp:44:0:
src/gpuvis_utils.h:35:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_1;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:36:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_2;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:37:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_3;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:38:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_4;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:39:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_5;
            ^~~~~~~~~~~~
src/gpuvis_graph.cpp: In member function ‘void graph_info_t::init_row_info(TraceWin*, const std::vector<GraphRows::graph_rows_info_t>&)’:
src/gpuvis_graph.cpp:385:36: error: ‘bind’ is not a member of ‘std’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_print_timeline, win, _1 );
                                    ^~~~
src/gpuvis_graph.cpp:385:36: note: suggested alternative: ‘find’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_print_timeline, win, _1 );
                                    ^~~~
                                    find
src/gpuvis_graph.cpp:385:87: error: ‘_1’ was not declared in this scope
             rinfo.render_cb = std::bind( &TraceWin::graph_render_print_timeline, win, _1 );
                                                                                       ^~
src/gpuvis_graph.cpp:385:87: note: suggested alternative: ‘y1’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_print_timeline, win, _1 );
                                                                                       ^~
                                                                                       y1
src/gpuvis_graph.cpp:390:36: error: ‘bind’ is not a member of ‘std’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_plot, win, _1 );
                                    ^~~~
src/gpuvis_graph.cpp:390:36: note: suggested alternative: ‘find’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_plot, win, _1 );
                                    ^~~~
                                    find
src/gpuvis_graph.cpp:390:77: error: ‘_1’ was not declared in this scope
             rinfo.render_cb = std::bind( &TraceWin::graph_render_plot, win, _1 );
                                                                             ^~
src/gpuvis_graph.cpp:390:77: note: suggested alternative: ‘y1’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_plot, win, _1 );
                                                                             ^~
                                                                             y1
src/gpuvis_graph.cpp:395:36: error: ‘bind’ is not a member of ‘std’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_timeline, win, _1 );
                                    ^~~~
src/gpuvis_graph.cpp:395:36: note: suggested alternative: ‘find’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_timeline, win, _1 );
                                    ^~~~
                                    find
src/gpuvis_graph.cpp:395:85: error: ‘_1’ was not declared in this scope
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_timeline, win, _1 );
                                                                                     ^~
src/gpuvis_graph.cpp:395:85: note: suggested alternative: ‘y1’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_timeline, win, _1 );
                                                                                     ^~
                                                                                     y1
src/gpuvis_graph.cpp:400:36: error: ‘bind’ is not a member of ‘std’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_hw_row_timeline, win, _1 );
                                    ^~~~
src/gpuvis_graph.cpp:400:36: note: suggested alternative: ‘find’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_hw_row_timeline, win, _1 );
                                    ^~~~
                                    find
src/gpuvis_graph.cpp:400:88: error: ‘_1’ was not declared in this scope
             rinfo.render_cb = std::bind( &TraceWin::graph_render_hw_row_timeline, win, _1 );
                                                                                        ^~
src/gpuvis_graph.cpp:400:88: note: suggested alternative: ‘y1’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_hw_row_timeline, win, _1 );
                                                                                        ^~
                                                                                        y1
src/gpuvis_graph.cpp:405:36: error: ‘bind’ is not a member of ‘std’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_events, win, _1 );
                                    ^~~~
src/gpuvis_graph.cpp:405:36: note: suggested alternative: ‘find’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_events, win, _1 );
                                    ^~~~
                                    find
src/gpuvis_graph.cpp:405:83: error: ‘_1’ was not declared in this scope
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_events, win, _1 );
                                                                                   ^~
src/gpuvis_graph.cpp:405:83: note: suggested alternative: ‘y1’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_events, win, _1 );
                                                                                   ^~
                                                                                   y1
In file included from src/gpuvis_utils.cpp:41:0:
src/gpuvis_utils.h:35:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_1;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:36:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_2;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:37:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_3;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:38:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_4;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:39:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_5;
            ^~~~~~~~~~~~
---- src/ya_getopt.c ----
---- src/hash_fnv.c ----
In file included from src/gpuvis.cpp:46:0:
src/gpuvis_utils.h:35:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_1;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:36:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_2;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:37:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_3;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:38:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_4;
            ^~~~~~~~~~~~
src/gpuvis_utils.h:39:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_5;
            ^~~~~~~~~~~~
make: *** [Makefile:143: _release/src/gpuvis_utils.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:143: _release/src/gpuvis_graph.o] Error 1
src/gpuvis.cpp: In static member function ‘static int TraceLoader::thread_func(void*)’:
src/gpuvis.cpp:663:35: error: ‘bind’ is not a member of ‘std’
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                   ^~~~
src/gpuvis.cpp:663:35: note: suggested alternative: ‘find’
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                   ^~~~
                                   find
src/gpuvis.cpp:663:63: error: ‘_1’ was not declared in this scope
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                                               ^~
src/gpuvis.cpp:663:63: note: suggested alternative: ‘y1’
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                                               ^~
                                                               y1
src/gpuvis.cpp:663:67: error: ‘_2’ was not declared in this scope
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                                                   ^~
src/gpuvis.cpp:663:67: note: suggested alternative: ‘._92’
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                                                   ^~
                                                                   ._92
src/gpuvis.cpp: In member function ‘void TraceLoader::init(int, char**)’:
src/gpuvis.cpp:684:32: error: ‘bind’ is not a member of ‘std’
     io.IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                ^~~~
src/gpuvis.cpp:684:32: note: suggested alternative: ‘find’
     io.IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                ^~~~
                                find
src/gpuvis.cpp:684:90: error: ‘_1’ was not declared in this scope
 .IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                                                                    ^~
src/gpuvis.cpp:684:90: note: suggested alternative: ‘y1’
 .IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                                                                    ^~
                                                                                          y1
src/gpuvis.cpp:684:94: error: ‘_2’ was not declared in this scope
 .IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                                                                        ^~
src/gpuvis.cpp:684:94: note: suggested alternative: ‘._92’
 .IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                                                                        ^~
                                                                                              ._92
src/gpuvis.cpp:685:32: error: ‘bind’ is not a member of ‘std’
     io.IniSaveSettingCB = std::bind( imgui_ini_save_settings_cb, _1, _2 );
                                ^~~~
src/gpuvis.cpp:685:32: note: suggested alternative: ‘find’
     io.IniSaveSettingCB = std::bind( imgui_ini_save_settings_cb, _1, _2 );
                                ^~~~
                                find
src/gpuvis.cpp: In member function ‘const std::vector<unsigned int>* TraceEvents::get_tdopexpr_locs(const char*, std::__cxx11::string*)’:
src/gpuvis.cpp:1361:47: error: ‘bind’ is not a member of ‘std’
         tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                               ^~~~
src/gpuvis.cpp:1361:47: note: suggested alternative: ‘find’
         tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                               ^~~~
                                               find
src/gpuvis.cpp:1361:86: error: ‘_1’ was not declared in this scope
       tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                                                                    ^~
src/gpuvis.cpp:1361:86: note: suggested alternative: ‘y1’
       tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                                                                    ^~
                                                                                      y1
src/gpuvis.cpp:1361:90: error: ‘_2’ was not declared in this scope
       tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                                                                        ^~
src/gpuvis.cpp:1361:90: note: suggested alternative: ‘._92’
       tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                                                                        ^~
                                                                                          ._92
src/gpuvis.cpp:1376:61: error: ‘bind’ is not a member of ‘std’
                 tdop_get_keyval_func get_keyval_func = std::bind( filter_get_keyval_func, &event, _1, _2 );
                                                             ^~~~
src/gpuvis.cpp:1376:61: note: suggested alternative: ‘find’
                 tdop_get_keyval_func get_keyval_func = std::bind( filter_get_keyval_func, &event, _1, _2 );
                                                             ^~~~
                                                             find
src/gpuvis.cpp: In member function ‘bool TraceWin::render()’:
src/gpuvis.cpp:1957:55: error: ‘bind’ is not a member of ‘std’
                 tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                       ^~~~
src/gpuvis.cpp:1957:55: note: suggested alternative: ‘find’
                 tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                       ^~~~
                                                       find
src/gpuvis.cpp:1957:109: error: ‘_1’ was not declared in this scope
 key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                                                    ^~
src/gpuvis.cpp:1957:109: note: suggested alternative: ‘y1’
 key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                                                    ^~
                                                                                                             y1
src/gpuvis.cpp:1957:113: error: ‘_2’ was not declared in this scope
 key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                                                        ^~
src/gpuvis.cpp:1957:113: note: suggested alternative: ‘._92’
 key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                                                        ^~
                                                                                                                 ._92
src/gpuvis.cpp:1966:69: error: ‘bind’ is not a member of ‘std’
                         tdop_get_keyval_func get_keyval_func = std::bind( filter_get_keyval_func, &event, _1, _2 );
                                                                     ^~~~
src/gpuvis.cpp:1966:69: note: suggested alternative: ‘find’
                         tdop_get_keyval_func get_keyval_func = std::bind( filter_get_keyval_func, &event, _1, _2 );
                                                                     ^~~~
                                                                     find
make: *** [Makefile:143: _release/src/gpuvis.o] Error 1
✗ fratti@archbook gpuvis $ mkdir build
✓ fratti@archbook gpuvis $ cd build/
✓ fratti@archbook build $ cmake ..
-- The C compiler identification is GNU 7.1.1
-- The CXX compiler identification is GNU 7.1.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
<FindSDL2.cmake>
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
</FindSDL2.cmake>
-- Found SDL2: /usr/lib/libSDL2main.a;/usr/lib/libSDL2.so;-lpthread  
-- Found Freetype: /usr/lib/libfreetype.so (found version "2.8.0") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'gtk+-3.0'
--   Found gtk+-3.0, version 3.22.15

CMAKE_C_FLAGS:  -DUSE_FREETYPE -static-libstdc++ -static-libgcc
CMAKE_CXX_FLAGS:  -DUSE_FREETYPE -static-libstdc++ -static-libgcc -std=c++11
CMAKE_EXE_LINKER_FLAGS: 
CMAKE_MODULE_LINKER_FLAGS: 
CMAKE_SHARED_LINKER_FLAGS: 
CMAKE_STATIC_LINKER_FLAGS: 

-- Configuring done
-- Generating done
-- Build files have been written to: /home/fratti/Projekte/gpuvis/build
✓ fratti@archbook build $ make -j4
Scanning dependencies of target gpuvis
[  5%] Building CXX object CMakeFiles/gpuvis.dir/src/gpuvis_utils.cpp.o
[ 11%] Building CXX object CMakeFiles/gpuvis.dir/src/gpuvis.cpp.o
[ 16%] Building CXX object CMakeFiles/gpuvis.dir/src/tdopexpr.cpp.o
[ 22%] Building CXX object CMakeFiles/gpuvis.dir/src/gpuvis_graph.cpp.o
In file included from /home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:44:0:
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:35:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_1;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:36:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_2;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:37:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_3;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:38:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_4;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:39:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_5;
            ^~~~~~~~~~~~
In file included from /home/fratti/Projekte/gpuvis/src/gpuvis_utils.cpp:41:0:
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:35:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_1;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:36:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_2;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:37:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_3;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:38:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_4;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:39:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_5;
            ^~~~~~~~~~~~
In file included from /home/fratti/Projekte/gpuvis/src/gpuvis.cpp:46:0:
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:35:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_1;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:36:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_2;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:37:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_3;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:38:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_4;
            ^~~~~~~~~~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_utils.h:39:12: error: ‘std::placeholders’ has not been declared
 using std::placeholders::_5;
            ^~~~~~~~~~~~
[ 27%] Building C object CMakeFiles/gpuvis.dir/src/ya_getopt.c.o
[ 33%] Building C object CMakeFiles/gpuvis.dir/src/hash_fnv.c.o
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp: In member function ‘void graph_info_t::init_row_info(TraceWin*, const std::vector<GraphRows::graph_rows_info_t>&)’:
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:385:36: error: ‘bind’ is not a member of ‘std’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_print_timeline, win, _1 );
                                    ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:385:36: note: suggested alternative: ‘find’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_print_timeline, win, _1 );
                                    ^~~~
                                    find
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:385:87: error: ‘_1’ was not declared in this scope
             rinfo.render_cb = std::bind( &TraceWin::graph_render_print_timeline, win, _1 );
                                                                                       ^~
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:385:87: note: suggested alternative: ‘y1’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_print_timeline, win, _1 );
                                                                                       ^~
                                                                                       y1
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:390:36: error: ‘bind’ is not a member of ‘std’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_plot, win, _1 );
                                    ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:390:36: note: suggested alternative: ‘find’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_plot, win, _1 );
                                    ^~~~
                                    find
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:390:77: error: ‘_1’ was not declared in this scope
             rinfo.render_cb = std::bind( &TraceWin::graph_render_plot, win, _1 );
                                                                             ^~
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:390:77: note: suggested alternative: ‘y1’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_plot, win, _1 );
                                                                             ^~
                                                                             y1
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:395:36: error: ‘bind’ is not a member of ‘std’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_timeline, win, _1 );
                                    ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:395:36: note: suggested alternative: ‘find’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_timeline, win, _1 );
                                    ^~~~
                                    find
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:395:85: error: ‘_1’ was not declared in this scope
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_timeline, win, _1 );
                                                                                     ^~
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:395:85: note: suggested alternative: ‘y1’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_timeline, win, _1 );
                                                                                     ^~
                                                                                     y1
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:400:36: error: ‘bind’ is not a member of ‘std’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_hw_row_timeline, win, _1 );
                                    ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:400:36: note: suggested alternative: ‘find’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_hw_row_timeline, win, _1 );
                                    ^~~~
                                    find
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:400:88: error: ‘_1’ was not declared in this scope
             rinfo.render_cb = std::bind( &TraceWin::graph_render_hw_row_timeline, win, _1 );
                                                                                        ^~
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:400:88: note: suggested alternative: ‘y1’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_hw_row_timeline, win, _1 );
                                                                                        ^~
                                                                                        y1
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:405:36: error: ‘bind’ is not a member of ‘std’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_events, win, _1 );
                                    ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:405:36: note: suggested alternative: ‘find’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_events, win, _1 );
                                    ^~~~
                                    find
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:405:83: error: ‘_1’ was not declared in this scope
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_events, win, _1 );
                                                                                   ^~
/home/fratti/Projekte/gpuvis/src/gpuvis_graph.cpp:405:83: note: suggested alternative: ‘y1’
             rinfo.render_cb = std::bind( &TraceWin::graph_render_row_events, win, _1 );
                                                                                   ^~
                                                                                   y1
[ 38%] Building CXX object CMakeFiles/gpuvis.dir/src/stlini.cpp.o
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp: In static member function ‘static int TraceLoader::thread_func(void*)’:
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:663:35: error: ‘bind’ is not a member of ‘std’
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                   ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:663:35: note: suggested alternative: ‘find’
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                   ^~~~
                                   find
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:663:63: error: ‘_1’ was not declared in this scope
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                                               ^~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:663:63: note: suggested alternative: ‘y1’
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                                               ^~
                                                               y1
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:663:67: error: ‘_2’ was not declared in this scope
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                                                   ^~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:663:67: note: suggested alternative: ‘._92’
     EventCallback trace_cb = std::bind( new_event_cb, loader, _1, _2 );
                                                                   ^~
                                                                   ._92
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp: In member function ‘void TraceLoader::init(int, char**)’:
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:684:32: error: ‘bind’ is not a member of ‘std’
     io.IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:684:32: note: suggested alternative: ‘find’
     io.IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                ^~~~
                                find
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:684:90: error: ‘_1’ was not declared in this scope
 .IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                                                                    ^~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:684:90: note: suggested alternative: ‘y1’
 .IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                                                                    ^~
                                                                                          y1
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:684:94: error: ‘_2’ was not declared in this scope
 .IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                                                                        ^~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:684:94: note: suggested alternative: ‘._92’
 .IniLoadSettingCB = std::bind( imgui_ini_load_settings_cb, &m_imguiwindow_entries, _1, _2 );
                                                                                        ^~
                                                                                              ._92
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:685:32: error: ‘bind’ is not a member of ‘std’
     io.IniSaveSettingCB = std::bind( imgui_ini_save_settings_cb, _1, _2 );
                                ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:685:32: note: suggested alternative: ‘find’
     io.IniSaveSettingCB = std::bind( imgui_ini_save_settings_cb, _1, _2 );
                                ^~~~
                                find
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp: In member function ‘const std::vector<unsigned int>* TraceEvents::get_tdopexpr_locs(const char*, std::__cxx11::string*)’:
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1361:47: error: ‘bind’ is not a member of ‘std’
         tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                               ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1361:47: note: suggested alternative: ‘find’
         tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                               ^~~~
                                               find
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1361:86: error: ‘_1’ was not declared in this scope
       tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                                                                    ^~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1361:86: note: suggested alternative: ‘y1’
       tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                                                                    ^~
                                                                                      y1
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1361:90: error: ‘_2’ was not declared in this scope
       tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                                                                        ^~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1361:90: note: suggested alternative: ‘._92’
       tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_strpool, _1, _2 );
                                                                                        ^~
                                                                                          ._92
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1376:61: error: ‘bind’ is not a member of ‘std’
                 tdop_get_keyval_func get_keyval_func = std::bind( filter_get_keyval_func, &event, _1, _2 );
                                                             ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1376:61: note: suggested alternative: ‘find’
                 tdop_get_keyval_func get_keyval_func = std::bind( filter_get_keyval_func, &event, _1, _2 );
                                                             ^~~~
                                                             find
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp: In member function ‘bool TraceWin::render()’:
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1957:55: error: ‘bind’ is not a member of ‘std’
                 tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                       ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1957:55: note: suggested alternative: ‘find’
                 tdop_get_key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                       ^~~~
                                                       find
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1957:109: error: ‘_1’ was not declared in this scope
 key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                                                    ^~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1957:109: note: suggested alternative: ‘y1’
 key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                                                    ^~
                                                                                                             y1
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1957:113: error: ‘_2’ was not declared in this scope
 key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                                                        ^~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1957:113: note: suggested alternative: ‘._92’
 key_func get_key_func = std::bind( filter_get_key_func, &m_trace_events.m_strpool, _1, _2 );
                                                                                        ^~
                                                                                                                 ._92
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1966:69: error: ‘bind’ is not a member of ‘std’
                         tdop_get_keyval_func get_keyval_func = std::bind( filter_get_keyval_func, &event, _1, _2 );
                                                                     ^~~~
/home/fratti/Projekte/gpuvis/src/gpuvis.cpp:1966:69: note: suggested alternative: ‘find’
                         tdop_get_keyval_func get_keyval_func = std::bind( filter_get_keyval_func, &event, _1, _2 );
                                                                     ^~~~
                                                                     find
make[2]: *** [CMakeFiles/gpuvis.dir/build.make:111: CMakeFiles/gpuvis.dir/src/gpuvis_utils.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/gpuvis.dir/build.make:87: CMakeFiles/gpuvis.dir/src/gpuvis_graph.cpp.o] Error 1
make[2]: *** [CMakeFiles/gpuvis.dir/build.make:63: CMakeFiles/gpuvis.dir/src/gpuvis.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/gpuvis.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Ability to load multiple files

This might not be something very interesting for the existing traces, but reading the code I thought it would be possible to load multiple files. Turns out there are few assumptions in the loading code that don't really account for that. Here is a list of a few, nothing major :

  • event IDs are allocated in trace-read.cpp, unfortunately if I add another "backend" generating events, there will clashes (it was easy to change)
  • the file loader thread seems to be only be able to deal with a single m_trace_win

Currently looking at changing the second issue, but I figured it would be good to check so that I don't do something stupid.

My use case is that I have traces generated by the GPU of what is actually running on the HW and I would like to add that to the existing timeline.
This could come handy on Intel HW where we have a microcode able to reorder workloads in the back of the i915 driver.

ltime= offset issue

I really appreciate the ltime change. It's a huge help. #36

But I'm having issues with it, even in the most basic case.

# cat /sys/kernel/tracing/trace_clock
[local] global counter uptime perf mono mono_raw boot

And

uint64_t GetTime()
{
        struct timespec tsp;
        clock_gettime( CLOCK_MONOTONIC, &tsp );
        return (uint64_t)tsp.tv_sec * 1000000LL + tsp.tv_nsec / 1000;
}

int main(int argc, char *argv[])
{
        printf( "test\n");

        int i;
        for( i = 0; ; i++ )
        {
                char st[100];
                sprintf( st, "[XXX] Event %d A", i );
                EventWriteString( st );
                usleep(100);
                sprintf( st, "[XXX] Event %d B", i );
                EventWriteString( st );
                usleep(100);
                sprintf( st, "[XXX] Event %d C", i );
                EventWriteString( st );
                usleep(100);
                sprintf( st, "[XXX] Event %d D ltime=%llu", i, GetTime()*1000 );
                EventWriteString( st );
                usleep(100);
                sprintf( st, "[XXX] Event %d E ltime=%llu", i, GetTime()*1000 );
                EventWriteString( st );
                usleep(100);
                sprintf( st, "[XXX] Event %d F ltime=%llu", i, GetTime() *1000);
                EventWriteString( st );
                usleep(1000);
                sprintf( st, "[XXX] Event %d G", i );
                EventWriteString( st );
                usleep(100);
                sprintf( st, "[XXX] Event %d H ltime=%llu", i, GetTime()*1000 );
                EventWriteString( st );
                sprintf( st, "[XXX] Event %d I", i );
                EventWriteString( st );
                usleep(10000);
        }

        return EXIT_SUCCESS;
}

I end up having things hop around on the timeline. Notice A, B, and C are good, but D, E and F are to late,then it hps back before for G and I. This is probably not an issue directly with gpuvis, but I was wondering if there was some trick to doing this? different time base? Maybe some way of specifying a "now" synchronous event? To synchronize ltime and system time?

image

Should be able to copy-paste from GPUVis Console

It would be nice to copy-paste from GPUVis console directly. On error as in #50 a window appears called "Gpuvis(sic!) Console" with the error log but selecting the text or copy-pasting everything via right click menu is not possible what makes reporting critical bugs like above cumbersome (in #50 I typed the log down manually).

Blank window and 100% CPU usage

Not entirely sure what's going on here. Other OpenGL applications work fine; but gpuvis has stopped working for me.

The annoying thing is that it's been quite some time since I last used gpuvis. I already know it's not a gpuvis regression (I can go back hundreds of commits and the behavior doesn't change, including to the commit that I was using previously without any issues).

glxinfo: https://0x0.st/sKso.txt
strace: https://0x0.st/sKsH.log

I tried using apitrace, but got unexpected behavior:

$ apitrace trace ./gpuvis
apitrace: loaded into /usr/bin/apitrace
apitrace: unloaded from /usr/bin/apitrace
apitrace: loaded into /home/nand/dev/gpuvis/build/gpuvis
apitrace: redirecting dlopen("libGL.so.1", 0x102)
apitrace: tracing to /home/nand/dev/gpuvis/build/gpuvis.trace
apitrace: redirecting dlopen("libGL.so.1", 0x102)
apitrace: redirecting dlopen("libGL.so.1", 0x102)
apitrace: redirecting dlopen("libGL.so.1", 0x101)
apitrace: warning: glVertexAttribPointer: call will be faked due to pointer to user memory (https://github.com/apitrace/apitrace/blob/master/docs/BUGS.markdown#tracing)
apitrace: warning: caught signal 11
apitrace: ignoring exception while tracing
/usr/bin/../lib64/apitrace/wrappers/glxtrace.so+0x2a88fc
/lib64/libpthread.so.0+0x14fff
/lib64/libc.so.6+0xaca94
/usr/bin/../lib64/apitrace/wrappers/glxtrace.so+0x2a81b4
/usr/bin/../lib64/apitrace/wrappers/glxtrace.so+0x2a5568
/usr/bin/../lib64/apitrace/wrappers/glxtrace.so: glDrawElements+0x1eb
./gpuvis: _Z32ImGui_ImplSdlGL3_RenderDrawListsP10ImDrawData+0x57d
./gpuvis: _ZN5ImGui6RenderEv+0x6b0
./gpuvis+0x187a19
./gpuvis: main+0x3f3
/lib64/libc.so.6: __libc_start_main+0xfc
./gpuvis: _start+0x29
?
apitrace: info: taking default action for signal 11
# command exited with return code 139

It immediately exited after printing those messages. The resulting trace is at https://0x0.st/sKsX.trace

If I try perf top to view what it's spending time doing, I get:


   PerfTop:    3895 irqs/sec  kernel: 0.6%  exact:  0.0% [4000Hz cycles],  (target_pid: 27564)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------                                               

    61.82%  gpuvis                 [.] ImFontAtlas::GetTexDataAsRGBA32
     4.55%  libfreetype.so.6.15.0  [.] gray_render_line
     3.02%  libfreetype.so.6.15.0  [.] gray_record_cell
     2.43%  gpuvis                 [.] stbrp__skyline_find_min_y
     2.29%  libc-2.26.so           [.] __memset_sse2_unaligned_erms
     1.96%  libfreetype.so.6.15.0  [.] gray_hline
     1.68%  libfreetype.so.6.15.0  [.] af_glyph_hints_reload
     1.31%  libfreetype.so.6.15.0  [.] gray_convert_glyph
     1.16%  libfreetype.so.6.15.0  [.] gray_set_cell
     1.14%  libfreetype.so.6.15.0  [.] TT_Load_Simple_Glyph
     1.08%  libfreetype.so.6.15.0  [.] af_latin_hints_compute_segments
     0.89%  libfreetype.so.6.15.0  [.] af_latin_hints_apply
     0.85%  gpuvis                 [.] stbrp__skyline_find_best_pos
     0.68%  libfreetype.so.6.15.0  [.] gray_render_conic
     0.67%  libfreetype.so.6.15.0  [.] FT_Outline_Get_CBox
     0.62%  libfreetype.so.6.15.0  [.] TT_RunIns
     0.62%  libfreetype.so.6.15.0  [.] af_latin_hints_link_segments
     0.56%  libfreetype.so.6.15.0  [.] af_latin_hints_compute_edges
     0.50%  libfreetype.so.6.15.0  [.] FT_Outline_Decompose
     0.45%  libfreetype.so.6.15.0  [.] af_glyph_hints_align_weak_points
     0.42%  libfreetype.so.6.15.0  [.] tt_cmap4_char_map_binary
     0.35%  libc-2.26.so           [.] __memmove_sse2_unaligned_erms
     0.32%  libfreetype.so.6.15.0  [.] af_glyph_hints_align_strong_points
     0.31%  libfreetype.so.6.15.0  [.] load_truetype_glyph
     0.27%  libfreetype.so.6.15.0  [.] FT_DivFix
     0.27%  libfreetype.so.6.15.0  [.] af_glyph_hints_save.isra.5
     0.26%  libfreetype.so.6.15.0  [.] af_autofitter_load_glyph
     0.26%  libfreetype.so.6.15.0  [.] FT_Load_Glyph
     0.25%  libc-2.26.so           [.] _int_free
     0.21%  libc-2.26.so           [.] malloc
     0.19%  libfreetype.so.6.15.0  [.] ft_smooth_render_generic
     0.18%  gpuvis                 [.] (anonymous namespace)::FreeTypeFont::BlitGlyph
     0.18%  libc-2.26.so           [.] _int_malloc
     0.18%  libc-2.26.so           [.] cfree@GLIBC_2.2.5
     0.18%  libfreetype.so.6.15.0  [.] TT_Load_Glyph
     0.18%  libfreetype.so.6.15.0  [.] ft_mem_qrealloc
     0.17%  libc-2.26.so           [.] tcache_get
     0.17%  libfreetype.so.6.15.0  [.] FT_Outline_Get_Orientation
     0.16%  libfreetype.so.6.15.0  [.] af_iup_interp.part.11
     0.16%  libfreetype.so.6.15.0  [.] FT_Outline_Translate
     0.15%  gpuvis                 [.] ImGuiFreeType::BuildFontAtlas
     0.13%  libfreetype.so.6.15.0  [.] af_axis_hints_new_edge
     0.13%  libfreetype.so.6.15.0  [.] FT_Glyph_To_Bitmap
     0.12%  libfreetype.so.6.15.0  [.] af_face_globals_new
     0.11%  libfreetype.so.6.15.0  [.] tt_face_get_metrics
     0.11%  libfreetype.so.6.15.0  [.] tt_loader_init
     0.11%  gpuvis                 [.] ImFontAtlasBuildRenderDefaultTexData
     0.11%  libc-2.26.so           [.] tcache_put
     0.10%  libfreetype.so.6.15.0  [.] TT_Load_Glyph_Header
     0.10%  libfreetype.so.6.15.0  [.] ft_mem_free
     0.09%  libfreetype.so.6.15.0  [.] gray_conic_to
     0.09%  libfreetype.so.6.15.0  [.] FT_MulDiv
     0.09%  libfreetype.so.6.15.0  [.] FT_Stream_ReadUShort
     0.09%  libfreetype.so.6.15.0  [.] gray_raster_render
     0.09%  libfreetype.so.6.15.0  [.] _iup_worker_interpolate.part.51
     0.09%  gpuvis                 [.] ImFont::AddGlyph
     0.09%  gpuvis                 [.] stbrp_pack_rects
     0.09%  libfreetype.so.6.15.0  [.] FT_Get_Next_Char
     0.08%  libc-2.26.so           [.] qsort
     0.08%  libfreetype.so.6.15.0  [.] gray_line_to
     0.08%  gpuvis                 [.] (anonymous namespace)::FreeTypeFont::CalcGlyphInfo
     0.08%  libfreetype.so.6.15.0  [.] ft_mem_alloc
     0.08%  libc-2.26.so           [.] memcpy@GLIBC_2.2.5
     0.08%  libfreetype.so.6.15.0  [.] tt_get_metrics

And a gdb backtrace from the busy thread:

^C
Thread 1 "gpuvis" received signal SIGINT, Interrupt.
0x00007f09d3d0c80c in af_glyph_hints_align_strong_points (hints=hints@entry=0x7ffdd1ebdb10, dim=dim@entry=AF_DIMENSION_VERT) at /usr/src/debug/media-libs/freetype-2.8.1/freetype-2.8.1/src/autofit/afhints.c:1328
1328	              if ( edges[nn].fpos >= u )
(gdb) bt
#0  0x00007f09d3d0c80c in af_glyph_hints_align_strong_points (hints=hints@entry=0x7ffdd1ebdb10, dim=dim@entry=AF_DIMENSION_VERT) at /usr/src/debug/media-libs/freetype-2.8.1/freetype-2.8.1/src/autofit/afhints.c:1328
#1  0x00007f09d3d6ce1e in af_latin_hints_apply (glyph_index=<optimized out>, hints=0x7ffdd1ebdb10, outline=<optimized out>, metrics=<optimized out>) at /usr/src/debug/media-libs/freetype-2.8.1/freetype-2.8.1/src/autofit/aflatin.c:3552
#2  0x00007f09d3d6e962 in af_loader_load_glyph (load_flags=<optimized out>, glyph_index=74, face=<optimized out>, module=<optimized out>, loader=0x7ffdd1ebda90) at /usr/src/debug/media-libs/freetype-2.8.1/freetype-2.8.1/src/autofit/afloader.c:429
#3  af_autofitter_load_glyph (module=<optimized out>, slot=<optimized out>, size=<optimized out>, glyph_index=74, load_flags=<optimized out>) at /usr/src/debug/media-libs/freetype-2.8.1/freetype-2.8.1/src/autofit/afmodule.c:561
#4  0x00007f09d3d17165 in FT_Load_Glyph (face=0x5575072d8610, glyph_index=74, load_flags=<optimized out>) at /usr/src/debug/media-libs/freetype-2.8.1/freetype-2.8.1/src/base/ftobjs.c:757
#5  0x00005575067ac052 in (anonymous namespace)::FreeTypeFont::CalcGlyphInfo(unsigned int, (anonymous namespace)::GlyphInfo&, FT_GlyphRec_*&, FT_BitmapGlyphRec_*&) ()
#6  0x00005575067ada6d in ImGuiFreeType::BuildFontAtlas(ImFontAtlas*, unsigned int) ()
#7  0x0000557506735e04 in ImGui_ImplSdlGL3_CreateFontsTexture(bool*) ()
#8  0x0000557506736258 in ImGui_ImplSdlGL3_CreateDeviceObjects(bool*) ()
#9  0x0000557506736663 in ImGui_ImplSdlGL3_NewFrame(SDL_Window*, bool*) ()
#10 0x0000557506663da4 in main ()

Linux kernel trace events changes

Hi,

I'm working on improving the gpu_scheduler trace events.

The events are changed to make fence tracking easier (context + seqno are printed consistently across events) and to contain the dependencies information (drm_sched_job_wait_dep already provided this, but partially).
Lastly, the device information to know which GPU is executing the job is now available as well.

The latest version of the patchset is currently up for review here: https://lists.freedesktop.org/archives/dri-devel/2024-June/457100.html - feel free to chime in and offer some feedback.

FWIW here's an short capture on a 2 GPUs system:

umr:cs0-6498           [016] .....   735.008761: drm_sched_job: id=51757, fence=(context:7914, seqno:920), ring=gfx_0.0.0, job count:0, hw job count:1, dependencies:{}
kworker/u128:0-11      [026] .....   735.008769: drm_run_job: dev=0000:0e:00.0, id=328, fence=(context:8442, seqno:145), ring=gfx_0.0.0, job count:0, hw job count:1
kworker/u128:2-2108    [027] .....   735.008776: drm_run_job: dev=0000:0b:00.0, id=51756, fence=(context:664, seqno:17099), ring=gfx_0.0.0, job count:0, hw job count:2
      Xorg:cs0-2504    [000] .....   735.008782: drm_sched_job: id=51758, fence=(context:664, seqno:17100), ring=gfx_0.0.0, job count:0, hw job count:2, dependencies:{}
  glxgears:cs0-6627    [019] .....   735.008788: drm_sched_job: id=427, fence=(context:8446, seqno:144), ring=sdma0, job count:0, hw job count:0, dependencies:{(context:8442, seqno:145)}
kworker/u128:2-2108    [027] .....   735.008796: drm_sched_job_wait_dep: job ring=sdma0, fence_context=8446, id=427, depends fence=(context:8442, seqno:145)
        <idle>-0       [026] d.h2.   735.008796: drm_sched_process_job: fence=(context:664, seqno:17098) signaled
kworker/u128:2-2108    [027] .....   735.008801: drm_sched_job_wait_dep: job ring=gfx_0.0.0, fence_context=7914, id=51757, depends fence=(context:664, seqno:17097)
kworker/u128:2-2108    [027] .....   735.008803: drm_run_job: dev=0000:0b:00.0, id=51757, fence=(context:7914, seqno:920), ring=gfx_0.0.0, job count:0, hw job count:2
        <idle>-0       [026] d.h2.   735.008840: drm_sched_process_job: fence=(context:664, seqno:17099) signaled

Intel i915_req_ring0 sections overlap

Hi,

I am trying to use gpuvis for analyzing Intel i915 workloads. I am using Debian unstable with a 4.13 kernel (CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is enabled).

I noticed that the i915_req ring0 shows overlapping events. If I'm not mistaken, those should actually be stacked, shouldn't they? I have attached a screenshot, plus the trace data file.

gpuvis_intel

gl_demo_intel_trace.dat.tar.gz

The trace is of a trivial GL demo app (spinning quad).

Do you have any pointers where to start looking on how to fix this?

Thanks,

Heinrich

trace-cmd-start-tracing.sh fails to starts with regexp error

System: GenToo 64-bit

Action to reproduce:

  1. Run "./trace-cmd-setup.sh", enter root password
  2. Run "./trace-cmd-start-tracing.sh"

Expected result:
Command succeeds

Actual result:

trace-cmd reset
trace-cmd: No such file or directory
  opening to '/sys/kernel/tracing/tracing_max_latency'

trace-cmd start -C mono -b 8000 -D -i -e sched:sched_switch -e sched:sched_process_fork -e sched:sched_process_exec -e sched:sched_process_exit -e drm:drm_vblank_event -e drm:drm_vblank_event_queued -e drm:drm_vblank_event_delivered -e amdgpu:amdgpu_vm_flush -e amdgpu:amdgpu_cs_ioctl -e amdgpu:amdgpu_sched_run_job -e *fence:*fence_signaled -e i915:i915_flip_request -e i915:i915_flip_complete -e i915:intel_gpu_freq_change -e i915:i915_gem_request_add -e i915:i915_gem_request_submit -e i915:i915_gem_request_in -e i915:i915_gem_request_out -e i915:i915_gem_request_queue -e i915:intel_engine_notify -e i915:i915_gem_request_wait_begin -e i915:i915_gem_request_wait_end -e i915:i915_request_add -e i915:i915_request_submit -e i915:i915_request_in -e i915:i915_request_out -e i915:i915_request_queue -e i915:i915_request_wait_begin -e i915:i915_request_wait_end -e i915:i915_request_retire -e i915:i915_request_execute -e i915:i915_pipe_update_vblank_evaded

trace-cmd stat

Events:
 Individual systems:
   drm
 Individual events:
    amdgpu
        amdgpu_cs_ioctl
        amdgpu_sched_run_job
        amdgpu_vm_flush
    dma_fence
        dma_fence_signaled
    sched
        sched_switch
        sched_process_exit
        sched_process_fork
        sched_process_exec

Buffer size in kilobytes (per cpu):
   8000

Buffer total size in kilobytes:
   64000

Clock: mono

Tracing is enabled

awk: cmd. line:3: warning: regexp escape sequence `\:' is not a known regexp operator
/sys/kernel/tracing/per_cpu/cpu0/stats entries:142 overrun:0 time:0.026693 sec
/sys/kernel/tracing/per_cpu/cpu1/stats entries:44 overrun:0 time:0.026986 sec
/sys/kernel/tracing/per_cpu/cpu2/stats entries:49 overrun:0 time:0.026994 sec
/sys/kernel/tracing/per_cpu/cpu3/stats entries:35 overrun:0 time:0.026403 sec
/sys/kernel/tracing/per_cpu/cpu4/stats entries:54 overrun:0 time:0.026894 sec
/sys/kernel/tracing/per_cpu/cpu5/stats entries:28 overrun:0 time:0.026428 sec
/sys/kernel/tracing/per_cpu/cpu6/stats entries:49 overrun:0 time:0.025293 sec
/sys/kernel/tracing/per_cpu/cpu7/stats entries:18 overrun:0 time:0.025415 sec

Can not load trace when using current trace-cmd master

Following error message appears in GPUVis log:

[Error] handle_options: unknown option 11
[Error] read_trace_file: setjmp error called for trace_06-15-2020_20-11-53.dat.
[Error] load_trace_file(trace_06-15-2020_20-11-53.dat) failed.

Get rid of trace-cmd

trace-cmd is licensed under GPL while all other dependencies use permissive licenses. This single dependency prevents incorporating this project into other projects which are under permissive license. To make this project more accessible i think trace-cmd should be removed and replaced with something which is under permissive license.

hash collision causing timeline display glitch

Hi, I'm seeing very strange hw execution times that doesn't make sense, and it even appears that the two jobs are executing on the same hw queue at the same time. so I did some debugging and found out that it's a hash collision at gpuvis.cpp:2048 get_event_gfxcontext_hash( event );
I added some printouts and this is some collisions I found

gfx_0.0.0_9057436_589 => 4090091432
comp_1.3.0_9399661_76 => 4090091432
gfx_0.0.0_9057436_586 => 936496110
comp_1.3.0_9399661_79 => 936496110
gfx_0.0.0_9266264_182 => 1750561699
gfx_0.0.0_1_4515358 => 1750561699
comp_1.1.1_9147603_373 => 237847852
comp_1.3.1_9_295083 => 237847852

can the implementation switch to using an more robust key value pair system? maybe just std::map

i915 ctx > 0xffff

Hitting an assert when loading a trace file :

Thread 7 "eventloader" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff1b53700 (LWP 19292)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) refresh
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7a8e535 in __GI_abort () at abort.c:79
#2  0x00007ffff7a8e40f in __assert_fail_base (fmt=0x7ffff7bf0710 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55555589c38a "ctx <= 0xffff", file=0x55555589c2f8 "/home/djdeath/src/mesa-src/gpuvis/src/gpuvis.cpp", line=180, function=<optimized out>) at assert.c:92
#3  0x00007ffff7a9bb92 in __GI___assert_fail (assertion=0x55555589c38a "ctx <= 0xffff", file=0x55555589c2f8 "/home/djdeath/src/mesa-src/gpuvis/src/gpuvis.cpp", line=180, function=0x55555589c338 "static uint64_t TraceLocationsRingCtxSeq::db_key(uint32_t, uint32_t, const char*)") at assert.c:101
#4  0x00005555556bc77d in TraceLocationsRingCtxSeq::db_key (ringno=0, seqno=490784, ctxstr=0x7fffe045d96b "465338") at /home/djdeath/src/mesa-src/gpuvis/src/gpuvis.cpp:180
#5  0x00005555556bc85c in TraceLocationsRingCtxSeq::db_key (event=...) at /home/djdeath/src/mesa-src/gpuvis/src/gpuvis.cpp:204
#6  0x00005555556bc886 in TraceLocationsRingCtxSeq::add_location (this=0x555555ede920, event=...) at /home/djdeath/src/mesa-src/gpuvis/src/gpuvis.cpp:213
#7  0x00005555556c236f in TraceEvents::init_i915_event (this=0x555555ede358, event=...) at /home/djdeath/src/mesa-src/gpuvis/src/gpuvis.cpp:1895
#8  0x00005555556c2979 in TraceEvents::init_new_event (this=0x555555ede358, event=...) at /home/djdeath/src/mesa-src/gpuvis/src/gpuvis.cpp:2043
#9  0x00005555556c2dcc in TraceEvents::init (this=0x555555ede358) at /home/djdeath/src/mesa-src/gpuvis/src/gpuvis.cpp:2128
#10 0x00005555556beb74 in MainApp::thread_func (data=0x5555559a8280 <s_app()::s_app>) at /home/djdeath/src/mesa-src/gpuvis/src/gpuvis.cpp:784
#11 0x00007ffff7eb7e8c in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#12 0x00007ffff7f2b119 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#13 0x00007ffff7e32fb7 in start_thread (arg=<optimized out>) at pthread_create.c:486
#14 0x00007ffff7b6349f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Not sure how a 64bit unique id could be constructed in a different way :(

drm:drm_vblank_event doesn't represent actual HW vblank

By default, GPUVis uses drm:drm_vblank_event trace points to identify vblank timings. While working on an Intel i915 trace, I learned that for this driver, the drm_vblank_event trace point does not represent the actual HW vblank timestamp, but only the CPU time the trace-point was hit during some irq handler (briefly discussed at #intel-gfx). In my tests, this timestamp was 200 - 400 us before the actual vblank. Supposedly, for a system under heavy load, this divergence becomes larger.

This can be a problem when analyzing tight timings with a GPUVis trace. For instance, we are scheduling a CPU wake-up time relative to the last vblank time we get through the user-space KMS API (which is HW corrected and accurate). During that wake-up, we commit display plane state as late as possible for it to make it for the next vblank. In GPUVis, this wake-up appears to be inaccurately scheduled, since the visualized vblank lines are based on inaccurate timings themselves. That lead to a few false conclusions on my side.

Unfortunately I don't have a good fix for this, and neither do I know if this problem also applies to AMD drivers. I just wanted to write this up here in case anyone else runs into this issue, and maybe to discuss alternative solutions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.