Skip to content

Instantly share code, notes, and snippets.

View Tarrasch's full-sized avatar
💭
I may be slow to respond.

Arash Rouhani Tarrasch

💭
I may be slow to respond.
View GitHub Profile
@Tarrasch
Tarrasch / gist:8937160
Created February 11, 2014 15:33
temp-gist
\RequirePackage{filecontents}
\begin{filecontents}{bachelorarbeit_lit.bib}
@ONLINE{java96,
author = {{Joe Black}},
title = {Foobar 1.0},
year = {1996},
month = {1},
url = {http://www.aaa.bb.cccc.dh/uploads/dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd.pdf},
urldate = {2011-03-02},
sortname = {Sun},
I got this file by running:
❯ "inplace/bin/ghc-stage1" -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Iincludes -optc-Iincludes/dist -optc-Iincludes/dist-derivedconstants/header -optc-Iincludes/dist-ghcconstants/header -optc-Irts -optc-Irts/dist/build -optc-DCOMPILING_RTS -optc-DDEBUG -optc-fno-strict-aliasing -optc-fno-common -optc-DUSE_DWARF -optc-O2 -optc-fomit-frame-pointer -optc-DRtsWay=\"rts_v\" -static -O -H64m -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -package-name rts -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -g -c rts/sm/Scav.c -o rts/dist/build/sm/Scav.o
and then I ran:
objdump --source rts/dist/build/sm/Scav.o | less
And man

Aw dammit they are still the same, why :(

I ran

diff <(objdump --source Scav_explicit.o | sed 's:<.*>::') <(objdump --source Scav_use.o | sed 's:<.*>::') | xclip

where the sed part is for removing all the relative symbol names that changes. It was to eliminate garbage like this:

163c163
<      1f9:     73 55                   jae    250 <scavenge_stack+0x70>
---
STATIC_INLINE StgPtr
scavenge_small_bitmap (StgPtr p, nat size, StgWord bitmap)
{
while (size > 0) {
if ((bitmap & 1) == 0) {
evacuate((StgClosure **)p);
}
p++;
bitmap = bitmap >> 1;
size--;
diff --git a/rts/sm/Compact.c b/rts/sm/Compact.c
index e9973d3..cdb487b 100644
--- a/rts/sm/Compact.c
+++ b/rts/sm/Compact.c
@@ -248,6 +248,20 @@ thread_large_bitmap( StgPtr p, StgLargeBitmap *large_bitmap, W_ size )
}
STATIC_INLINE StgPtr
+thread_small_bitmap (StgPtr p, nat size, StgWord bitmap)
+{
@Tarrasch
Tarrasch / CmmParse.hs
Created February 22, 2014 22:47
compiler/stage2/build/CmmParse.hs
{-# OPTIONS_GHC -w #-}
{-# OPTIONS -fglasgow-exts -cpp #-}
{-# LANGUAGE BangPatterns #-} -- required for versions of Happy before 1.18.6
{-# OPTIONS -Wwarn -w #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and fix
-- any warnings in the module. See
-- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
-- for details
@Tarrasch
Tarrasch / explenation.markdown
Created March 24, 2014 15:20
Relevance of DWARF sections for stack traces in Haskell

In this little gist I will look at how it helps the debug data to use all the sections in the binary.

I will first compile the program with -g (using Peter's patches). Then I'll run it once and will get a quite nice stack trace. I will then succesively strip out important debug information and rerun the binary (without recompiling of course!). The result will be that the stack trace is degrading for each stripping, and we can then get a sense for the usefulness of each DWARF section in the binary.

@Tarrasch
Tarrasch / stream_count.py
Created August 29, 2014 08:33
Currently, our skeleton doesn't instantiate everything
import datetime
import luigi
from spotify.luigi.crunch import ScrubJobTask, load_avsc
from spotify.luigi import HdfsTarget
from spotify.luigi.external_shrek_anonym import CreateEndSongCleaned
class SampleEndSongSubset(luigi.ExternalTask):
def output(self):
return HdfsTarget("/user/spotify-analytics-data/examples/data_pipeline_crunch/stream_count_anonym")
~/spotify/repos/gcp-migrate various-improvements
❯ git remote -v
origin git@ghe.spotify.net:arash/gcp-migrate.git (fetch)
origin git@ghe.spotify.net:arash/gcp-migrate.git (push)
upstream https://ghe.spotify.net/datainfra/gcp-migrate.git (fetch)
upstream https://ghe.spotify.net/datainfra/gcp-migrate.git (push)
~/spotify/repos/gcp-migrate various-improvements
❯ git fetch --all
Fetching origin