diff --git a/files/mockup_prelude.cc b/files/mockup_prelude.cc
index edb4196114c569155229e144ebc7eff7909453e4..5a865c00d21149f8b9dc36be34e8d6cbeb0c2251 100644
--- a/files/mockup_prelude.cc
+++ b/files/mockup_prelude.cc
@@ -99,8 +99,8 @@ uint32_t hash_os_state() {
     return first_hash ^ second_hash;
 }
 
-void _print_os_state(int line) {
-	kout << "Line " << line << " in state ";
+void _print_os_state(const char *syscall, int line) {
+	kout << "Line " << line << " before syscall " << syscall << " in state ";
 	kout << "0x" << hex << hash_os_state() << dec << endl;
 	fflush(stdout);
 }
@@ -120,7 +120,7 @@ int _decisionMaker(int i) {
 }
 
 void PreIdleHook() {
-	_print_os_state(__LINE__);
+	_print_os_state("PreIdleHook", __LINE__);
         ShutdownMachine();
 }
 
diff --git a/src/CFG/C.hs b/src/CFG/C.hs
index 578e19c2e5fb8f8901757b2488aa048b84668f4a..bf38d0f902a4e8a35e4a5efb29a892969d89a8a6 100644
--- a/src/CFG/C.hs
+++ b/src/CFG/C.hs
@@ -77,7 +77,7 @@ instrToC (IfThanElse decision left right) =
   "  goto " <> right <> ";"
 instrToC (Call ident False) = ident <> "();"
 instrToC (Call ident True)  =
-  "_print_os_state(__LINE__);\n"
+  "_print_os_state(\"" <> ident <> "\", __LINE__);\n"
   <> ident <> "();"
 instrToC Return = "return;"
 
diff --git a/test/CFG/CSpec.hs b/test/CFG/CSpec.hs
index ed29d4a178120bda6ba6bad3f85574f3788bd268..e64ebf8c63e2055eb571f7a5817f0b44b2be37ed 100644
--- a/test/CFG/CSpec.hs
+++ b/test/CFG/CSpec.hs
@@ -41,7 +41,7 @@ example1OutputLines =
   , "  goto Two;"
   , "else"
   , "  goto Zero;"
-  , "_print_os_state(__LINE__);"
+  , "_print_os_state(\"syscall\", __LINE__);"
   , "syscall();"
   , "Two:"
   , "goto One;"