This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*------------------------------------------------------------------------- | |
This source file is a part of OGRE | |
(Object-oriented Graphics Rendering Engine) | |
For the latest info, see http://www.ogre3d.org/ | |
Copyright (c) 2000-2013 Torus Knot Software Ltd | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// launch python through GDB to break in CPP code | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "GDB Python: Current File", | |
"type": "cppdbg", | |
"request": "launch", | |
"program": "/usr/bin/python", | |
"args": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL2/SDL.h> | |
#include <SDL2/SDL_vulkan.h> | |
#include <vulkan/vulkan.hpp> | |
#include <algorithm> | |
VkBool32 debug_callback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, | |
VkDebugUtilsMessageTypeFlagsEXT messageTypes, | |
const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData) | |
{ | |
auto types = vk::to_string((vk::DebugUtilsMessageTypeFlagsEXT)messageTypes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# compile with -fno-omit-frame-pointer | |
# usermode | |
sudo sh -c "echo 0 > /proc/sys/kernel/kptr_restrict" | |
sudo sh -c 'echo 1 >/proc/sys/kernel/perf_event_paranoid' | |
# record with callgraph | |
perf record -g $1 | |
# display with inverse callgraph | |
perf report -g 'graph,0.5,caller' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g++ -std=c++11 -O3 -S -masm=intel -fverbose-asm main.cpp # -mllvm --x86-asm-syntax=intel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstring> | |
#include <cmath> | |
#include <cstdio> | |
#include <ctime> | |
#include <cstdlib> | |
#include <vector> | |
#define NITER 100//5000000 | |
int main() { | |
clock_t t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstring> | |
#include <cmath> | |
#include <cstdio> | |
#include <ctime> | |
#include <cstdlib> | |
#include <sstream> | |
#define NITER 5000000 | |
int main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc -O3 -S -masm=intel -fverbose-asm test.c | |
// (code : out : in : clobber) | |
asm volatile ("" :: "g"(&a) : "memory"); | |
// see also: https://www.youtube.com/watch?v=nXaxk27zwlk |