Use UDEB system starter in debug_stem_rom.oby, and add tools\summarise_kerneltrace.pl to filter out most of the kerneltracing detail
authorWilliam Roberts <williamr@symbian.org>
Wed, 13 Oct 2010 21:40:50 +0100
changeset 33 900525f287f9
parent 32 5d6e2a54a44a
child 34 33a3c5f8b4c8
Use UDEB system starter in debug_stem_rom.oby, and add tools\summarise_kerneltrace.pl to filter out most of the kerneltracing detail
syborg_stem/debug_stem_rom.oby
tools/summarise_kerneltrace.pl
--- a/syborg_stem/debug_stem_rom.oby	Wed Oct 13 17:17:03 2010 +0100
+++ b/syborg_stem/debug_stem_rom.oby	Wed Oct 13 21:40:50 2010 +0100
@@ -1,6 +1,7 @@
-REM KPROC = 0x40
+REM KPROC = 0x40, KTHREAD = 0x200
 kerneltrace 0x80000040
 
+REM UDEB version of ekern.exe, system startup, nvgrenderstage 
 ROM_IMAGE[0] {
 #include "syborg_stem_features.iby"
 
@@ -1441,7 +1442,7 @@
 REM Feature QoS is not included in this ROM
 REM --- DNS Proxy 
 file=\epoc32\release\ARMV5\urel\dnsproxyclient.dll 	"sys\bin\dnsproxyclient.dll"
-__ECOM_PLUGIN(\epoc32\release\ARMV5\urel,Sys\Bin,\epoc32\data\Z,Resource\Plugins, nvgrenderstage.dll , nvgrenderstage.dll ) 
+__ECOM_PLUGIN(\epoc32\release\ARMV5\UDEB,Sys\Bin,\epoc32\data\Z,Resource\Plugins, nvgrenderstage.dll , nvgrenderstage.dll ) 
 file=\epoc32\release\ARMV5\urel\obexservermtm.dll 	"sys\bin\obexservermtm.dll" 
 file=\epoc32\release\ARMV5\urel\obexclientmtm.dll 	"sys\bin\obexclientmtm.dll" 
 file=\epoc32\release\ARMV5\urel\obexmtmutil.dll 	"sys\bin\obexmtmutil.dll" 
@@ -1925,11 +1926,11 @@
 data=\epoc32\data\Z\Private\101F413C\backup_registration.xml 	"private\101F413C\backup_registration.xml"
 REM SQLITE3
 file=\epoc32\release\ARMV5\urel\sqlite3.dll 	"sys\bin\sqlite3.dll" 
-file=\epoc32\release\ARMV5\urel\ssmcmn.dll 	"sys\bin\ssmcmn.dll"
-file=\epoc32\release\ARMV5\urel\ssmcmd.dll 	"sys\bin\ssmcmd.dll"
-file=\epoc32\release\ARMV5\urel\sysstatemgr.exe 	"sys\bin\sysstatemgr.exe"
-file=\epoc32\release\ARMV5\urel\ssmstartsafe.dll 	"sys\bin\ssmstartsafe.dll"
-file=\epoc32\release\ARMV5\urel\domainpolicy2.dll 	"sys\bin\domainpolicy2.dll"
+file=\epoc32\release\ARMV5\UDEB\ssmcmn.dll 	"sys\bin\ssmcmn.dll"
+file=\epoc32\release\ARMV5\UDEB\ssmcmd.dll 	"sys\bin\ssmcmd.dll"
+file=\epoc32\release\ARMV5\UDEB\sysstatemgr.exe 	"sys\bin\sysstatemgr.exe"
+file=\epoc32\release\ARMV5\UDEB\ssmstartsafe.dll 	"sys\bin\ssmstartsafe.dll"
+file=\epoc32\release\ARMV5\UDEB\domainpolicy2.dll 	"sys\bin\domainpolicy2.dll"
 file=\epoc32\release\ARMV5\urel\subtitlegraphic.dll 	"sys\bin\subtitlegraphic.dll"
 __ECOM_PLUGIN(\epoc32\release\ARMV5\urel,Sys\Bin,\epoc32\data\Z,Resource\Plugins, subtitlegraphicdrawer.dll , subtitlegraphicdrawer.dll ) 
 REM surface update client\server
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/summarise_kerneltrace.pl	Wed Oct 13 21:40:50 2010 +0100
@@ -0,0 +1,110 @@
+# Copyright (c) 2010 Symbian Foundation Ltd.
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+# This script filters kernel trace output to the bare essentials
+
+use strict;
+
+my %processes;
+my %threadcount;
+my %instancecount;
+my %originalname;
+my @deathlist;
+
+my $line;
+while ($line = <>)
+	{
+	# AddThread ekern.exe::NVMem-ecc10dce to ekern.exe
+	# Process FLogSvr.exe Die: 0 0 Kill
+	# DLibrary domainSrv.exe::domainpolicy2.dll Close m=-1
+	# Thread MTMInit::Via Infrared Via Infrared   Panic MTMInit 5
+	# DProcess::Rename MSexe.exe to !MsvServer
+	if ( $line =~ /^(AddThread |Process \S+ Die: |DLibrary |Thread |DProcess::Rename )/o)
+		{
+		
+		if ($line =~ /^DProcess::Rename (\S+) to (\S+)/o)
+			{
+			my $oldname = $1;
+			my $process = $2;
+		printf "Renaming %s (%d,%d) to %s\n", $oldname, $processes{$oldname}, $threadcount{$oldname}, $process;
+			$processes{$process} = $processes{$oldname};
+			$threadcount{$process} = $threadcount{$oldname};
+			$instancecount{$process} = $instancecount{$oldname};
+
+			$originalname{$process} = $oldname;
+			delete $processes{$oldname};
+			delete $threadcount{$oldname};
+			}
+		if ($line =~ /^AddThread (\S+)::(\S+) to (\S+)$/o)
+			{
+			my $process = $1;
+			my $thread = $2;
+			
+			if ($thread eq "Main" || $thread eq "Null")
+				{
+				# New process created
+				$processes{$process} = $.;
+				$threadcount{$process} = 0;
+				}
+			$threadcount{$process} += 1;
+			if (!defined $instancecount{$process})
+				{
+				$instancecount{$process} = 0;
+				}
+			$instancecount{$process} += 1;
+			}
+		print "$.: $line";
+
+		if ($line =~ /^Process (\S+) Die: (.*)$/o)
+			{
+			my $process = $1;
+			my $details = $2;
+			my $summary = sprintf "#%d, %d threads, lifetime %d-%d",
+				$instancecount{$process},$threadcount{$process},$processes{$process},$.;
+			
+			print "\t$process: $summary\n";
+			delete $processes{$process};
+			delete $threadcount{$process};
+
+			chomp $line;	
+			push @deathlist, sprintf "%7d\t%-20s %s, died %s", $., $process, $summary, $details;
+			}
+		next;
+		}
+
+	# Initiating transition to state 0000.ffff.
+	# R:\sf\os\devicesrv\sysstatemgmt\systemstatemgr\cmd\src\ssmcommandbase.cpp 135: Completing command with errorcode 0
+	# ***** Execute cmd no. 11 without a delay
+	# Starting : Z:\sys\bin\splashscreen.exe with arguments :  and Execution behaviour : 1
+	if ( $line =~ /^(Initiating transition |\*\*\*\*\* |Starting : )/o)
+		{
+		print "SSM: $line";
+		next;
+		}
+
+	if ($line =~ /^(MODE_USR:)/o)
+		{
+		# it's crashed
+		print $line, <>;
+		last;
+		}
+	}
+
+printf "\n\nActive processes (%d):\n", scalar keys %processes;
+foreach my $process (sort keys %processes)
+	{
+	printf "%-25s\t%d threads, created at line %d\n", $process, $threadcount{$process}, $processes{$process};
+	}
+
+printf "\n\nDead processes (%d)\n", scalar @deathlist;
+print join("\n", sort @deathlist, "");