Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,11 @@ vogl_build/*
voglinc/
*~
*.swp
\#*
.\#*
*.a
*.bin

_out*/
__nix_qt5__
/result
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: nix
script: nix-build shell.nix
sudo: true
# Sudo containers start slower, but are isolated in a VM and get 8G of RAM, instead of 4G.

cache:
directories:
- /nix
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
add_subdirectory(src/libbacktrace) # 10
add_subdirectory(src/libbacktrace_test) # 11
endif()

89 changes: 72 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,85 @@
vogl
=============

#### NOTE ####

April 16, 2014: Vogl history has been completely and utterly trounced. The original repository had an entire chroot build system that most folks weren't interested in. A few contributors (thanks Carl & Sir Anthony) took the time to build a much smaller source only vogl repository which we've replaced the original one with.

A separate chroot repository (which will build this source repository) is now here:

https://bitbucket.org/raddebugger/vogl_chroot
[![Build Status](https://travis-ci.org/deepfire/vogl.svg?branch=master)](https://travis-ci.org/deepfire/vogl)

## Warning ##

This project is alpha^2. If you are up for suffering through a bit of pain with early releases, please jump in - we'd love to have your help...

## Dependencies ##

The chroot configuration script should be a good reference for vogl dependencies. It is located here:

https://bitbucket.org/raddebugger/vogl_chroot/src/master/bin/chroot_configure.sh?at=master

The build dependencies for ubuntu (14.04) can be installed using the following:
The build dependencies for ubuntu (14.04) can be installed either using APT:
```
sudo apt-get install build-essential pkg-config cmake libx11-dev \
zip wget libtinyxml-dev liblzma-dev libunwind8-dev \
libturbojpeg libdwarf-dev mesa-common-dev qt5-qmake\
freeglut3-dev qt5-default libqt5x11extras5-dev git \
libsdl2-gfx-dev libsdl2-image-dev libsdl2-ttf-dev libjpeg-turbo8-dev
```
> .. or using Nix, for which keep reading.

### Get Source and Build ###

There are two build methods, due to development environment setup mechanisms: Nix and chroot.

1. The Nix-based method:

- distribution-agnostic, but requires the Nix package manager to be installed
- fire-and-forget
- integrated with Travis CI
- allows fine dependency specification
- 100% declarative -- you get what you ask for (nothing is implied by any kind of "state")
- currently suffers from https://github.com/NixOS/nixpkgs/issues/9415
- ..but there is a remedy (nVidia-only at the moment): https://github.com/deepfire/nix-install-vendor-gl

2. The old, chroot-based method.

#### Nix-based ####

##### Linux (Mac OS X untested, but not impossible) ####

First, you need to have Nix installed (citing http://nixos.org/nix/manual/#ch-installing-binary):

```
desktop@steamos:~/src/vogl$ bash <(curl https://nixos.org/nix/install)
...

## At the end, this will instruct you to either re-login,
## or source the Nix environment setup script. Do that.
## Validation:

desktop@steamos:~/src/vogl$ nix-env --query --installed # ..which should list just `nix`, initially.
```
> NOTE: If security implications of this particular step worry you, please read
> the following piece by Domen Kožar:
> https://www.domenkozar.com/2015/09/27/friends-sometimes-let-friends-curl-to-shell/)

## Get Source and Build ##
Once that's behind us, the following two options become available:

#### Linux ####
1. Building and installing the package into the current user environment:

```
desktop@steamos:~/src/vogl$ nix-env --no-build-output --cores 0 -iE 'f: (import ./shell.nix {})'
these derivations will be built:
/nix/store/zvdz4dhprf6kbnjf5sjcc8731rnbmd1z-vogl-2016-05-13.drv
building path(s) ‘/nix/store/b88a5flgwjghw204wg5j8ahqs50l2qba-vogl-2016-05-13’
_makeQtWrapperSetup
unpacking sources
unpacking source archive /nix/store/qm11psc7pp4nk2273msgln3x519iv1pb-vogl-cbc5f18
...

...
```

2. Entering the fully-dependency endowed build environment:
```
nix-shell
```


#### Chroot-based ####

##### Linux ####

```
git clone https://github.com/ValveSoftware/vogl.git
Expand All @@ -44,7 +93,7 @@ The binaries are placed in the vogl/vogl_build directory.
For debug builds, use "-DCMAKE_BUILD_TYPE=Debug"
For 32-bit builds, use "-DBUILD_X64=Off"

#### Windows ####
##### Windows ####

```
git clone https://github.com/ValveSoftware/vogl.git
Expand All @@ -60,7 +109,7 @@ cmake -DQt5_DIR="C:\Qt\5.3\msvc2013_opengl\lib\cmake\Qt5" -G "Visual Studio 12 2
Note: The path to Qt5 might need to be adjusted depending on your install location.
After compiling with Visual Studio, the binaries are placed in the vogl\vogl_build\Release (or Debug) directory.

### Mac OS X ###
##### Mac OS X ###

Install the required build dependencies using Homebrew:

Expand Down Expand Up @@ -95,6 +144,12 @@ https://bitbucket.org/raddebugger/vogl_chroot/src/master/bin/src/sl.cpp?at=maste

We are currently working on making it much easier to launch and profile Steam apps.

Note, that `vogleditor` used to attempt to launch the target application while
preloading both 32-bit and 64-bit versions of the capture libraries, but this was
error-prone -- in certain systems that would prevent the editor-based capturing at
all. So this was disabled, and now `vogleditor` only preloads captures of a
single architecture -- one matching the particular `vogl` build, 32 or 64-bit.

## Replay ##

```
Expand Down
52 changes: 52 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -*- indent-tabs-mode: nil -*-
{ cmake, git, pkgconfig, wget, zip
, makeQtWrapper, qtbase, qtx11extras
, libdwarf, libjpeg_turbo, libunwind, lzma, tinyxml, libX11
, SDL2, SDL2_gfx, SDL2_image, SDL2_ttf
, freeglut, mesa, mesa_glu
##
, fetchgit, stdenv
, localSource ? false
}:
let
ver = "2016-05-13";
in
stdenv.mkDerivation {
name = "vogl-${ver}";
version = "${ver}";

src = fetchgit {
url = if localSource == false then "https://github.com/deepfire/vogl.git" else ("file://" + localSource);
rev = "cbc5f1853e294b363f16c4e00b3e0c49dbf74559";
sha256 = "17gwd73x3lnqv6ccqs48pzqwbzjhbn41c0x0l5zzirhiirb3yh0n";
};

nativeBuildInputs = [
makeQtWrapper pkgconfig
];

buildInputs = [
cmake git pkgconfig wget zip
qtbase qtx11extras
libdwarf libjpeg_turbo libunwind lzma tinyxml libX11
SDL2 SDL2_gfx SDL2_image SDL2_ttf
freeglut mesa mesa_glu
];

enableParallelBuilding = true;

dontUseCmakeBuildDir = true;
preConfigure = ''
cmakeDir=$PWD
mkdir -p vogl/vogl_build/release64 && cd $_
'';
cmakeFlags = '' -DCMAKE_VERBOSE=On -DCMAKE_BUILD_TYPE=Release -DBUILD_X64=On'';

meta = with stdenv.lib; {
description = "OpenGL capture / playback debugger.";
homepage = https://github.com/ValveSoftware/vogl;
license = licenses.bsd3;
maintainers = with maintainers; [ deepfire ];
platforms = platforms.all;
};
}
5 changes: 5 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ nixpkgs ? import <nixpkgs> {} }:

nixpkgs.pkgs.libsForQt56.callPackage
(import ./.)
{ }
6 changes: 6 additions & 0 deletions src/glxspheres/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ target_link_libraries(${PROJECT_NAME}

build_options_finalize()

#
# Installation
#
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
6 changes: 6 additions & 0 deletions src/ktxtool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ target_link_libraries(${PROJECT_NAME}

build_options_finalize()

#
# Installation
#
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
7 changes: 7 additions & 0 deletions src/voglbench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@ target_link_libraries(${PROJECT_NAME}
)

build_options_finalize()

#
# Installation
#
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
6 changes: 6 additions & 0 deletions src/voglcmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ target_link_libraries(${PROJECT_NAME}

build_options_finalize()

#
# Installation
#
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
7 changes: 7 additions & 0 deletions src/vogleditor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,10 @@ if (MSVC)
endif()

build_options_finalize()

#
# Installation
#
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
2 changes: 1 addition & 1 deletion src/vogleditor/vogleditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ VoglEditor::Prompt_Result VoglEditor::prompt_generate_trace()
#endif

QString cmdLine = m_pLaunchTracerDialog->get_command_line();
QProcessEnvironment env = m_pLaunchTracerDialog->get_process_environment();
QProcessEnvironment env = m_pLaunchTracerDialog->get_process_environment (sizeof (void *) < 8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that it's particularly common, but this means a 64-bit vogleditor could not launch and trace a 32-bit application, because you're only going to inject the 64-bit tracer.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. The problem is, leaving this as-is was breaking the tracing in my case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The true answer to this question, IMO, is figuring out how to build a separate, 32-bit tracer using Nix.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plohrmann, I have addressed your suggestion (I think)

bool bSuccess = launch_application_to_generate_trace(cmdLine, env);
QFileInfo fileInfo(m_pLaunchTracerDialog->get_trace_file_path());
if (bSuccess && fileInfo.exists())
Expand Down
5 changes: 2 additions & 3 deletions src/vogleditor/vogleditor_qapicalltreemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ bool vogleditor_QApiCallTreeModel::init(vogl_trace_file_reader *pTrace_reader)
{
QString msg(QString("*** Information: unpaired \"") + QString(g_vogl_entrypoint_descs[entrypoint_id].m_pName) + QString("\"."));
vogleditor_output_message(msg.toStdString().c_str());
vogl_printf(msg.toStdString().c_str());
vogl_printf("\n");
vogl_printf("%s\n", msg.toStdString().c_str());
}
}
else if (isMarkerPushEntrypoint(entrypoint_id))
Expand Down Expand Up @@ -387,7 +386,7 @@ bool vogleditor_QApiCallTreeModel::init(vogl_trace_file_reader *pTrace_reader)
{
QString msg(QString("*** Information: unpaired \"") + QString(g_vogl_entrypoint_descs[entrypoint_id].m_pName) + QString("\"."));
vogleditor_output_message(msg.toStdString().c_str());
vogl_printf(msg.toStdString().c_str());
vogl_printf("%s", msg.toStdString().c_str());
vogl_printf("\n");
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/vogleditor/vogleditor_qlaunchtracerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ QString vogleditor_QLaunchTracerDialog::get_command_line()
return cmdline;
}

QProcessEnvironment vogleditor_QLaunchTracerDialog::get_process_environment()
QProcessEnvironment vogleditor_QLaunchTracerDialog::get_process_environment(bool just32bits)
{
QDir appDirectory(QCoreApplication::applicationDirPath());

Expand Down Expand Up @@ -119,9 +119,7 @@ QProcessEnvironment vogleditor_QLaunchTracerDialog::get_process_environment()
m_process_environment.insert("VOGL_CMD_LINE", VOGL_CMD_LINE);
}

QString libvogltrace32 = appDirectory.absoluteFilePath("./libvogltrace32.so");
QString libvogltrace64 = appDirectory.absoluteFilePath("./libvogltrace64.so");
QString LD_PRELOAD = libvogltrace32 + ":" + libvogltrace64;
QString LD_PRELOAD = appDirectory.absoluteFilePath(just32bits ? "./libvogltrace32.so" : "./libvogltrace64.so");

if (getenv("LD_PRELOAD"))
{
Expand Down
2 changes: 1 addition & 1 deletion src/vogleditor/vogleditor_qlaunchtracerdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class vogleditor_QLaunchTracerDialog : public QDialog

QString get_application_to_launch();
QString get_command_line();
QProcessEnvironment get_process_environment();
QProcessEnvironment get_process_environment(bool just32bits);
QString get_trace_file_path();

private
Expand Down
6 changes: 6 additions & 0 deletions src/voglgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,9 @@ endif()

build_options_finalize()

#
# Installation
#
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
6 changes: 6 additions & 0 deletions src/voglreplay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ target_link_libraries(${PROJECT_NAME}

build_options_finalize()

#
# Installation
#
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
5 changes: 2 additions & 3 deletions src/voglreplay/replay_tool_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,11 @@ tool_trace_mode(vogl::vector<command_line_param_desc> *desc)
vogl_message_printf("Logfile: %s", args.vogl_logfile.c_str());
vogl_printf(" (will have PID appended)\n");

dynamic_string vogltracepath32 = getfullpath("libvogltrace32.so");
dynamic_string vogltracepath64 = getfullpath("libvogltrace64.so");
dynamic_string vogltracepath = getfullpath((sizeof(void *) < 8) ? "libvogltrace32.so" : "libvogltrace64.so");

// set up LD_PRELOAD string
dynamic_string LD_PRELOAD = "LD_PRELOAD=\"";
LD_PRELOAD += vogltracepath32 + ":" + vogltracepath64;
LD_PRELOAD += vogltracepath;

if (is_steam_file || getenv("LD_PRELOAD"))
LD_PRELOAD += ":$LD_PRELOAD";
Expand Down
6 changes: 6 additions & 0 deletions src/voglserver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ target_link_libraries(${PROJECT_NAME}

build_options_finalize()

#
# Installation
#
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
6 changes: 6 additions & 0 deletions src/vogltest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,9 @@ target_link_libraries(${PROJECT_NAME}

build_options_finalize()

#
# Installation
#
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
5 changes: 5 additions & 0 deletions src/vogltrace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,8 @@ endif()

build_options_finalize()

#
# Installation
#
install(TARGETS vogltrace
LIBRARY DESTINATION bin)