run the hook only in non optimized mode

Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>