Saturday, January 9, 2010

smatch_scripts/show_unreachable.sh

Smatch prints out stuff like this:
net/rds/send.c +395 rds_send_acked_before(13) info: ignoring unreachable code.

The show_unreachable.sh script lets you browse through all of those pretty quickly.

It prints output like this:


=========================================================
drivers/mca/mca-device.c +69
{
struct mca_bus *mca_bus = to_mca_bus(mca_dev->dev.parent);

return mca_bus->f.mca_read_pos(mca_dev, reg);

---------------------------------------------------------
return mca_dev->pos[reg];
}
EXPORT_SYMBOL(mca_device_read_pos);


You can scroll through an entire kernel worth of unreachable code in about 15 minutes.

No comments:

Post a Comment