Gingerbreadでbootchartしようとするとinit.cでエラーになる

まぁ、こんなこと今更スギだな。


ググっても、質問している人しか出てこないので、一応書いておくけど、もはやAOSPでGingerbreadのビルドする人で、かつbootchartしようなんて人がいるとも思えない。


bootchartで、INIT_BOOTCHART=trueでinitをビルドすると、エラーになる。

system/core/init/init.c: In function 'bootchart_init_action':
system/core/init/init.c:649: error: no return statement in function returning non-void
make: *** [out/target/product/hogemoge/obj/EXECUTABLES/init_intermediates/init.o] Error 1


たぶん、これで治ると思う。

$ vi system/core/init/init.c

#if BOOTCHART
static int bootchart_init_action(int nargs, char **args)
{
    bootchart_count = bootchart_init();
    if (bootchart_count < 0) {
        ERROR("bootcharting init failure\n");
    } else if (bootchart_count > 0) {
        NOTICE("bootcharting started (period=%d ms)\n", bootchart_count*BOOTCHART_POLLING_MS);
    } else {
        NOTICE("bootcharting ignored\n");
    }
    return 0; ←追加
}
#endif

ちなみに、調べたら、4.0.xでは修正されている。
3.x系はソース検索が見当たらないので調べていない。