The Firmware Test Suite (fwts) is a tool containing a large set of tests to exercise and diagnose firmware related bugs in x86 PC firmware. So what new shiny features have appeared in the new Ubuntu Raring 13.04 release?
UEFI specific tests to exercise and stress test various UEFI run time services:
* Stress test for miscellaneous run time service interfaces.
* Test get/set time interfaces.
* Test get/set wakeup time interfaces.
* Test get variable interface.
* Test get next variable name interface.
* Test set variable interface.
* Test query variable info interface.
* Set variable interface stress test.
* Query variable info interface stress test.
* Test Miscellaneous runtime service interfaces.
These use a new kernel driver to allow fwts to access the kernel UEFI run time interfaces. The driver is built and installed using DKMS.
ACPI specific improvements:
* Improved ACPI 5.0 support
* Annotated ACPI _CRS (Current Resource Settings) dumping.
Kernel log scanning (finds and diagnoses errors as reported by the kernel):
* Improved kernel log scanning with an additional 450 tests.
This release also includes many small bug fixes as well as minor improvements to the layout of the output of some of the tests.
Many thanks to Alex Hung, Ivan Hu, Keng-Yu Lin and Matt Fleming for all the improvements to fwts for this release.
Friday, 26 April 2013
Sunday, 21 April 2013
Valgrind stack traces
Sometimes when debugging an application it is useful to generate a stack dump when a specific code path is being executed. The valgrind tool provides a very useful and easy to use mechanism to do this:
1. Add in the following to the source file:
There are a collection of very useful tricks to be found in the Valgrind online manual which I recommend perusing at your leisure.
1. Add in the following to the source file:
#include <valgrind/valgrind.h>
2. Generate the stack trace at the point you desire (and print a specific message) using VALGRIND_PRINTF_BACKTRACE(), for example: VALGRIND_PRINTF_BACKTRACE("Stack trace @ %s(), %d", __func__, __LINE__);
3. Run the program with valgrind. You may wish to use the --tool=none option to make valgrind run a little faster: valgrind --tool=none ./generate/unix/bin64/acpiexec *.dat
4. Observe the strack trace. For example, I added this to the ACPICA acpiexec in AcpiDsInitOneObject() and got stack traces such as: ACPI: SSDT 0x563a480 00249 (v01 LENOVO TP-SSDT2 00000200 INTL 20061109)
**7129** Stack trace @ AcpiDsInitOneObject(), 174 at 0x416041: VALGRIND_PRINTF_BACKTRACE (in /home/king/repos/acpica/generate/unix/bin64/acpiexec)
==7129== by 0x4160A6: AcpiDsInitOneObject (in /home/king/repos/acpica/generate/unix/bin64/acpiexec)
==7129== by 0x441F76: AcpiNsWalkNamespace (in /home/king/repos/acpica/generate/unix/bin64/acpiexec)
==7129== by 0x416312: AcpiDsInitializeObjects (in /home/king/repos/acpica/generate/unix/bin64/acpiexec)
==7129== by 0x43D84D: AcpiNsLoadTable (in /home/king/repos/acpica/generate/unix/bin64/acpiexec)
==7129== by 0x450448: AcpiTbLoadNamespace (in /home/king/repos/acpica/generate/unix/bin64/acpiexec)
==7129== by 0x4502F6: AcpiLoadTables (in /home/king/repos/acpica/generate/unix/bin64/acpiexec)
==7129== by 0x405D1A: AeInstallTables (in /home/king/repos/acpica/generate/unix/bin64/acpiexec)
==7129== by 0x4052E8: main (in /home/king/repos/acpica/generate/unix/bin64/acpiexec)
There are a collection of very useful tricks to be found in the Valgrind online manual which I recommend perusing at your leisure.
Friday, 1 March 2013
Pragmatic Graphing
Over the past few days I have been analysing various issues and also doing some background research, so I have been collecting some rather large sets of data to process. Normally I filter, re-format and process the data using a bunch of simple tools such as awk, tr, cut, sort, uniq and grep to get the data into some form where it can be plotted using gnuplot.
The UNIX philosophy of piping together a bunch of tools to produce the final output normally works fine, however, graphing the data with gnuplot always ends up with me digging around in the online gnuplot documentation or reading old gnuplot files to remind myself exactly how to plot the data just the way I want. This is fine for occasions where I gather lots of identical logs and want to compare results from multiple tests, the investment in time to automate this with gnuplot is well worth the hassle. However, some times I just have a handful of samples and want to plot a graph and then quickly re-jig the data and perhaps calculate some statistical information such a trend lines. In this case, I fall back to shoving the samples into LibreOffice Calc and slamming out some quick graphs.
This makes me choke a bit. Using LibreOffice Calc starts to make me feel like I'm an accountant rather than a software engineer. However, once I have swallowed my pride I have come to the conclusion that one has to be pragmatic and use the right tool for the job. To turn around small amounts of data quickly, LibreOffice Calc does seem to be quite useful. For processing huge datasets and automated graph plotting, gnuplot does the trick (as long as I can remember how to use it). I am a command line junkie and really don't like using GUI based power tools, but there does seem to be a place where I can mix the two quite happily.
The UNIX philosophy of piping together a bunch of tools to produce the final output normally works fine, however, graphing the data with gnuplot always ends up with me digging around in the online gnuplot documentation or reading old gnuplot files to remind myself exactly how to plot the data just the way I want. This is fine for occasions where I gather lots of identical logs and want to compare results from multiple tests, the investment in time to automate this with gnuplot is well worth the hassle. However, some times I just have a handful of samples and want to plot a graph and then quickly re-jig the data and perhaps calculate some statistical information such a trend lines. In this case, I fall back to shoving the samples into LibreOffice Calc and slamming out some quick graphs.
This makes me choke a bit. Using LibreOffice Calc starts to make me feel like I'm an accountant rather than a software engineer. However, once I have swallowed my pride I have come to the conclusion that one has to be pragmatic and use the right tool for the job. To turn around small amounts of data quickly, LibreOffice Calc does seem to be quite useful. For processing huge datasets and automated graph plotting, gnuplot does the trick (as long as I can remember how to use it). I am a command line junkie and really don't like using GUI based power tools, but there does seem to be a place where I can mix the two quite happily.
Wednesday, 19 December 2012
..and now something seasonal
The Christmas holidays are almost here and to celebrate I've mildly obfuscated some C that prints the lyrics to a traditional English carol.
The source code can be found here
#include <stdio.h>
#include <stdbool.h>
#include <malloc.h>
#define H malloc (1237) ;
#define c while
#define W >> /* fallen right tree */
#define w << /* fallen left tree */
#define B(wish,times) ((_ &wish) times 2)
#define L {o Q=q;p(3[Z]),P(false[Z],q),\
p(q>2?"th":N),p(Z[2]);c(true+Q)p(q|Q?Q?\
N:4[Z]:"a "),P(1[Z],Q),p(Q>1?", ":N),--\
Q;p(".\n\n"),++q;}
char typedef o;void typedef d
;
o*N
="";o
q;o*O(o
*p){o
*P,_;o*
f=P=H;c(_
=*p)_^=1,*f
++=B(1,w)|B(4
,W)|B(2,w)|
B(8,W)|(_&240
),++p,*f=false;
return P;}d p(o*f
){fputs(f,stdout);}
d P(o*s,o o){c( o
--){c(122-*s)s++; s
++;}c(122-*s)putchar(
*s++);} o main(void){o*
Z[]={O("hgy}p{}dmnj`{pcg"
"y`{hny{hgh{}gs{}dxdj{"
"dglc{jgj{pdj{dbdxdj{p|d"
"bh{"),O("qeypyg`ld!gj!e!q"
"dey!pydd{p|n!ptypbd!`nxd}{p"
"cydd!Hydjmc!Cdj}{hnty!mnbbw!i"
"gy`"
"}{h"
"gxd"
"!ln"
"b`d"
"j!ygjl}{}gs!ldd}"
"d&e&bewgjl{}dxdj"
"!}|ej}&e&}|gff"
"gjl{dglcp!feg`"
"}&e&fgbogjl{jgjd!be`gd}!`ejmgjl{pdj!bny`}&e&bdeqgjl{"
"dbdxdj!qgqdy}&qgqgjl{p|dbxd!`ytffdy}!`ytffgjl{") ,O (
"!`ew!nh!Mcyg}pfe}!fw!pytd!bnxd!lexd!pn!fd!"),O("Nj!p"
"cd!"),O("!ej`!e!")};L L L L L L L L L L L L /*Xmas*/}
Subscribe to:
Posts (Atom)