From: Namhyung Kim Date: Wed, 22 Apr 2015 07:18:19 +0000 (+0900) Subject: perf hists browser: Split popup menu actions - part 2 X-Git-Tag: omap-for-v4.3/legacy-v2-signed~210^2~50^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea7cd59233097984850adc0e4119644f089be734;p=pandora-kernel.git perf hists browser: Split popup menu actions - part 2 Currently perf_evsel__hists_browse() function spins on a huge loop and handles many key actions. Since it's hard to read and modify, let's split it out into small helper functions. The add_XXX_opt() functions are to register popup menu item on the selected entry. When it adds an item, it also saves related data into struct popup_action and returns 1 so that it can increase the number of items (nr_options). With this change, we can simplify the code just to call selected callback function without considering various conditions. A callback function named do_XXX is called with saved data when the item is selected by user. No functional change intended. Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: David Ahern Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1429687101-4360-9-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- Reading git-diff-tree failed