instrumentation

Month

August 2009

59 posts

OMAP gets some upstream lovin'. → article.gmane.org
Aug 24, 2009
GSoC 2009 - Building Maemo from OpenEmbedded → rkirti.wordpress.com

Kirtika took on a really difficult project for her summer of code and made wonderful progress.  In short she wrote a ton of recipes to build as much of Nokia’s Maemo distro as possible from OpenEmbedded.  A really neat project and I expect it to just get better and attract more developers in time.

Aug 19, 2009
use cscope to navigate your code. no srsly, use it.

I went off the deep end earlier this year and decided I must have a full GUI IDE for writing code.  No one can explain this phenomena, seeing how througout all of 2007 and 2008 I used ratpoison exclusively as my window manager.

With an increased need to develop and test GNOME components I did eventually switch to a full GNOME desktop environment on my work PC and with that came a sort of freakish hunger to use Anjuta or Eclipse or whatever to reach some kinda of mouse-clicky C-navigating nirvana.

Big mistake.  I won’t go into the reasons why Eclipse’s CDT code indexer just breaks all over itself on epic codebases such as Linux (which use lots of macro defs and GCC extensions) or why Anjuta insists on littering my git repository with things I simply don’t want.  The point is that I came back to my senses and once again started using vim with cscope.

The following is a quick set of steps to get cscope up and running quickly for the specific case of Linux kernel development.  I won’t be setting up some central location for storing cscope files such as ~/cscope/ nor will I by using $CSCOPE_DB.  Instead I’m just going to create the index files in the root of my kernel git tree where they will safely be ignored by the .gitignore file there.

The working directory will need to always be the root of my kernel tree this way.  IE, if I cd to $LINUX/drivers/video/omap/ and then open a file there, cscope will not work for me.  Instead cd simply to $LINUX and then ‘vim drivers/video/omap/whatever.c’.  Got it?  Good.

Install cscope if you haven’t already.  For Debian derivatives:

sudo apt-get install cscope

For convenience install the vim keymap plugin for cscope from here.  The rest of this tutorial will take place in the top level of the kernel source:

cd ~/linux-omap-2.6/

Use the following command to create a list of files to index.  More notes on this method below the code block:

find . -path "./arch/*" ! -path "./arch/arm*" -prune -o -path "./include/asm-*" ! -path "./include/asm-arm*" -prune -o -path "./tmp*" -prune -o -path "./Documentation*" -prune -o -path "./scripts*" -prune -o -name "*.[chxsS]" -print >  cscope.files

The above find command populates cscope.files with a list files for indexing.  This includes drivers and arch/arm since I care about OMAP and ARM.  However I don’t care about indexing code from other architectures, nor do I care about indexing the docs, scripts and other stuff.  I could also fine tune this to only care about OMAP-specific arch stuff, but I’ve left it as generic for all ARM machines for readability.

Experiment with that command to construct a list of files that is perfect for your needs.  Now lets use cscope.files to generate the data needed by cscope proper:

cscope -b -q -k

This command will create cscope.out and some other files.  Now I’m ready to start using the index.  First I’ll skip straight to the definition of some symbol:

vim -t spi_device

The above will probably pull up a text menu giving me options with the line from each relevant source file containing that symbol.  In my kernel sources I get four options, the fourth of which is the actual struct definition in include/linux/spi/spi.h.  I just need to press ‘4’ and ‘enter’ and boom I’m whisked away to that file.  Neat huh?

Now inside of spi.h I will put cursor anywhere over the file path in:

#include <linux/device.h>

and quickly tap Ctrl-\ + f.  That is to say “hold control and backslash at the same time and then quickly tap f”.  The “f” in this combo means “take me to the file under my cursor” and of course is only relevant to file paths.  This becomes handy quickly.

Say I open drivers/video/omap2/displays/panel-zoom2.c and put my cursor over the path in:

#include <mach/mux.h>

Hitting Ctrl-\ + f results in the following menu popping up:

Cscope tag: mach/mux.h
#   line  filename / context / line
1      1  arch/arm/mach-davinci/include/mach/mux.h <<<unknown>>>
2      1  arch/arm/plat-omap/include/mach/mux.h <<<unknown>>>
Type number and <Enter> (empty cancels):

For anyone that has had to keep track of multiple architectures or get used to a new kernel version that has a different layout of code this is clearly helpful.

Probably the feature I use the most is the cursor symbol search.  This works identical to the cursor file search above, but instead of placing the cursor on a file path you just place it over a symbol.  For example in the same panel-zoom2.c I can put my mouse over the function name in:

static void zoom2_panel_disable(struct omap_dss_device *dssdev)
{
if (dssdev->platform_disable)
dssdev->platform_disable(dssdev);
mdelay(4);
}

and press Ctrl-\ + s.  This present a menu showing all of the uses of ‘zoom2_panel_disable’ in the code.  In this case they are all local to panel-zoom2.c but they could be all over the place.  Likewise if I just want the global defininition of a symbol instead of a list of every place it exists I can use Ctrl-\ + g.

I don’t have have my cursor over a symbol to search for it either (though this will often by the case).  In vim’s command mode I can run:

:cscope find s omap3_enable_io_chain

And I will be greeted with the familiar window you get when using cursor symbol search.  To see more options for command mode search just run:

:cscope

Finally I can use Ctrl-t to pop these search results off of the stack and effectively go backwards through my search.  This is helpful for digging into code I am not familiar with in a source file, finding out all of the details through cscope searches, and then backing out to my original files to write slightly more enlightened code.

Aug 19, 2009
Zoom2 support in Poky

I’m currently in the process of pushing Zoom2 support to upstream Poky.  I feel like there is a lot of unfocused energy that wants this to happen at TI, but no one is set on doing it.  Conveniently I enjoy such work so very slowly I have started to send merge requests to Richard Purdie’s tree.

The first of the commits can be found here and here.  No display is present since the kernel recipes so far don’t include the pending DSS2 changes.  Hopefully those will get merged soon or I’ll have to patch them in or make yet another kernel recipe.

Some interesting design issues are up for debate.  What is the most graceful way to build GLES libs from the publically available SDK?  Which kernels should be supported? IE, Google’s OMAP Android tree, Tony Lindgren’s upstream linux-omap, feature trees like Kevin Hilman’s linux-omap-pm or Tomi Valkeinen’s DSS2 tree.

I’ve also been in talks with Rob Clark about how best to write recipes that build DSP-side code.  I’m fond of a generic coprocessor.bbclass that any recipe can use as a template for specifying toolchain oddities, architecture type (so DSP recipes don’t get mixed with your primary board architecture) and other bits that might be useful to a wide array of different coprocessors.

I’d like any such changes to make to both Poky and OpenEmbedded, so if you have thoughts these subjects please chime in!

Aug 17, 2009
new beginnings

Ah tumblr.  How I missed thee.  Apparently tumblr hasn’t been missing me.  I am surprised to find that this blog has carried on like a bizarro version of twitter, steadily republishing tweets, brightkite updates and delicious bookmark saves for months and months.  Who knew?

Well there is a new sheriff in town and I’m conscripting this blog into the OMAP Linux Expeditionary Force.  May our enterprise prosper and profit!

So what does it all mean?  This blog will immediately cease to regurgitate all of my digital living and instead be re-purposed as a true web log, complete with punditry, projects, pictures and prospecting.  If you still want to track all of my digital doings online (and why wouldn’t you?) you can do so on twitter, where one can easily find fascinating topics such as where I am located, recent github.com commits and my latest bookmarks saved to delicious.  Substantiating!

Some topics I hope to cover on this blog are SDR on the Beagle board, GNOME Mobile development, Zoom2 hacking, power management on OMAP and my prognostications on the fascinating and turbulent wireless market.  I also hack on Poky, a mobile-focused OpenEmbedded derivative and my paycheck is primarily resultant from Android kernel development which seems a popular item at the moment.  Please drop me a line, suggest a topic for discussion and in general be an awesome netizen.

Aug 17, 2009

woke up in a cold sweat; I had forgotten today was the ISO audit! Got to work in record time and cleaned up my cube something fierce.

Aug 17, 2009

I’m at Texas Instruments Inc - http://bkite.com/0aR3b

Aug 17, 2009

I’m at Highland Park - http://bkite.com/0aPEK

Aug 17, 2009

hell yeah! finally a new #fon coming to the USA! http://bit.ly/2z2Klj

Aug 17, 2009

lap 1

Aug 16, 2009

I’m at Dallas-Fort Worth International Airport - http://bkite.com/0aMmN

Aug 16, 2009

got hit with overage charge on my AT&T wireless bill. I want a data-only plan with a nice voip solution. voice sucks.

Aug 15, 2009

I’m at Texas Instruments Inc - http://bkite.com/0aJWG

Aug 15, 2009

I’m at Highland Park - http://bkite.com/0aG3l

Aug 13, 2009
sourCEntral → man.sourcentral.org
Aug 13, 2009

Just added myself to the http://wefollow.com twitter directory under: #linux #cycling #opensource

Aug 12, 2009

I’m at Texas Instruments Inc - http://bkite.com/0aFbZ

Aug 12, 2009

srsly, facebook is evil. don’t be fooled by the friendfeed thing. http://bit.ly/aQwD

Aug 12, 2009

it can be hard to focus on the same project every day. that is why one needs other projects to focus on. diversity is important.

Aug 12, 2009

I’m at Highland Park - http://bkite.com/0aAx5

Aug 11, 2009

watching sesame street during breakfast. how is it possible that big bird can’t read a book after all these years?

Aug 11, 2009

lap 2

Aug 9, 2009

lap 1

Aug 9, 2009

gonna try some homemade steamed egg rolls filled with sweet potato on tomorrow’s ride. hopefully i have invented the perfect on-bike food!

Aug 9, 2009

I’m at Highland Park - http://bkite.com/0avaA

Aug 9, 2009

starting ride.

Aug 9, 2009

lap 5

Aug 9, 2009

lap 3

Aug 9, 2009

fin!

Aug 9, 2009

lap 4

Aug 9, 2009

I’m at Chipotle - Central Expressway - http://bkite.com/0awFL

Aug 9, 2009

shared a workout on Strands on http://www.strands.com/mturquette/posts/12737581: ‘Rode intervals and did sprint-repeats in Allen. Was …

Aug 9, 2009

Start using Mint.com to manage your money today! http://bit.ly/GLBHi

Aug 7, 2009
ELC 2009 videos - Free Electrons blog → free-electrons.com
Aug 7, 2009
maemo 5 alpha → maemo-beagle.garage.maemo.org
Aug 7, 2009

2009 Rouleur Magazine - Competitive Cyclist http://bit.ly/I9HvU

Aug 6, 2009
Inline Functions In C → greenend.org.uk
Aug 6, 2009
2009 Hincapie A Ride with George Hincapie DVD - Competitive Cyclist → competitivecyclist.com
Aug 6, 2009
2009 Rouleur Magazine - Competitive Cyclist → competitivecyclist.com
Aug 6, 2009
2009 Rapha Guide to the Great Climbs of the Pyrenees - Competitive Cyclist → competitivecyclist.com
Aug 6, 2009

linux-omap Mail Archive http://bit.ly/ndS0u

Aug 5, 2009

vim and linux CodingStyle - Bart’s Blog http://bit.ly/1a4IEE

Aug 5, 2009

stomach ache today. think i’ve been drinking too much coffee.

Aug 5, 2009

I’m at Texas Instruments Inc - http://bkite.com/0amAf

Aug 5, 2009

Inline Functions In C http://bit.ly/9ppPS

Aug 5, 2009
Embedded Linux system development - Free Electrons → free-electrons.com
Aug 4, 2009
linux-omap Mail Archive → mail-archive.com
Aug 4, 2009
vim and linux CodingStyle - Bart's Blog → jukie.net
Aug 4, 2009
Wonderful World of Linux 2.6 - Joe Pranevich → kniggit.net
Aug 4, 2009
Porting device drivers to the 2.6 kernel [LWN.net] → lwn.net
Aug 4, 2009
Next page →
2012 2013
  • January 1
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
2011 2012 2013
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
2010 2011 2012
  • January
  • February 1
  • March 2
  • April 1
  • May
  • June
  • July
  • August
  • September 3
  • October 3
  • November
  • December
2009 2010 2011
  • January
  • February 2
  • March 1
  • April 1
  • May 1
  • June 2
  • July
  • August
  • September
  • October 2
  • November
  • December
2008 2009 2010
  • January 20
  • February 20
  • March 5
  • April 7
  • May 15
  • June 31
  • July 79
  • August 59
  • September 4
  • October 2
  • November 2
  • December
2008 2009
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August 35
  • September 50
  • October 11
  • November 21
  • December 21