Skip to content

Instantly share code, notes, and snippets.

💭
Nothing

Suchakra Sharma tuxology

💭
Nothing
View GitHub Profile
View bcc-setup.sh
#!/bin/bash
set -e -x
git clone https://github.com/svinota/pyroute2.git
(cd pyroute2; make install)
numcpu=$(grep -c ^processor /proc/cpuinfo)
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build/
@tuxology
tuxology / output.txt
Last active Sep 22, 2015
Ping Latency with ftrace
View output.txt
<idle>-0 [000] d... 318152.015828: do_IRQ <-ret_from_intr
<idle>-0 [000] d.h. 318152.015832: irq_handler_entry: irq=45 name=iwlwifi
<idle>-0 [000] dNh. 318152.015837: sched_wakeup: comm=irq/45-iwlwifi pid=598 prio=49 success=1 target_cpu=000
<idle>-0 [000] d... 318152.015846: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=irq/45-iwlwifi next_pid=598 next_prio=49
irq/45-iwlwifi-598 [000] d.s. 318152.015894: sched_wakeup: comm=ping pid=27782 prio=120 success=1 target_cpu=002
<idle>-0 [002] d... 318152.015943: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=ping next_pid=27782 next_prio=120
ping-27782 [002] .... 318152.015952: sys_exit: NR 47 = 84
ping-27782 [002] .... 318152.015983: sys_exit: NR 1 = 97
View irqsoff-ubench1-out.txt
[root@linus tracing]# cat trace
# tracer: irqsoff
#
# irqsoff latency trace v1.1.5 on 4.3.0-rc3+
# --------------------------------------------------------------------
# latency: 9994 us, #14/14, CPU#1 | (M:desktop VP:0, KP:0, SP:0 HP:0 #P:4)
# -----------------
# | task: insmod-29922 (uid:0 nice:0 policy:0 rt_prio:0)
# -----------------
# => started at: do_one_initcall
View disable_cpu_scaling.sh
#!/bin/bash
set_scaling_gov() {
gov=${1-performance}
for i in $(ls -1 /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor); do
echo ${gov} | sudo tee $i > /dev/null
done
}
set_scaling_gov
@tuxology
tuxology / Makefile
Created May 17, 2013
Tracepoint to get integer values from mutatee + modifications for x86_64 libs
View Makefile
all: dyntp.so mutator mutatee
dyntp.so: dyntp.o
gcc -shared -fPIC -DPIC $^ -ldl -llttng-ust -O0 -o $@
dyntp.o: dyntp.c ust_test.h
gcc -I. -fno-strict-aliasing -Wall -g -O0 -c $< -fPIC -DPIC -o $@
mutator: mutator.o
g++ $^ -L/usr/lib64/dyninst -ldyninstAPI -o $@
@tuxology
tuxology / Makefile
Last active Dec 20, 2015
Gives address of a given symbol in the binary and size of the first instruction at that symbol address. depends on libbfd and libdistorm3. Distorm64 may work too
View Makefile
sym2addr:sym2addr.c
gcc -Wall -ggdb sym2addr.c -o sym2addr -lbfd -ldistorm3
clean:
rm -f sym2addr
View .muttrc
# IMAP server Login
set spoolfile=imaps://yourdomain.com/INBOX
set imap_user=your.email.id@yourdomain.com
mailboxes = imaps://yourdomain.com/INBOX
set imap_check_subscribed
# Useful if you use the sidebar-patched mutt
set sidebar_width= 30
set sidebar_visible= yes
View JUDY.P8
-- JUDY --
-- Based on demo by Shane Riley's : https://gist.github.com/shaneriley/cae98eac6136e7293b28 --
player = {}
player.x = 20
player.y = 20
player.sprite = 0
player.speed = 3
function move()
player.moving = true
View bpf-llvm-setup.sh
#!/bin/bash
set -e -x
numcpu=$(grep -c ^processor /proc/cpuinfo)
git clone https://github.com/llvm-mirror/llvm.git
git clone https://github.com/llvm-mirror/clang.git llvm/tools/clang
mkdir llvm/build/
cd llvm/build/
cmake .. \
@tuxology
tuxology / disCPUscaling.sh
Last active Dec 8, 2016
Disable CPU Scaling
View disCPUscaling.sh
#!/bin/bash
# For more info : https://wiki.archlinux.org/index.php/CPU_frequency_scaling
set_scaling_gov() {
gov=${1-performance}
for i in $(ls -1 /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor); do
echo ${gov} | sudo tee $i > /dev/null
done
}
You can’t perform that action at this time.