perf: Fix event group context move
perf: Fix event group context move

When we have group with mixed events (hw/sw) we want to end up
with group leader being in hw context. So if group leader is
initialy sw event, we move all the events under hw context.

The move is done for each event by removing it from its context
and adding it back into proper one. As a part of the removal the
event is automatically disabled, which is not what we want at
this stage of creating groups.

The fix is to initialize event state after removal from sw
context.

This fix resulted from the following discussion:

  http://thread.gmane.org/gmane.linux.kernel.perf.user/1144

Reported-by: Andreas Hollmann <6ba223ba4cca624c7c0068454a5b4bd1dd9ed39c@in.tum.de>
Signed-off-by: Jiri Olsa <2c6594f608aa3d41e98d48846a6328831f7084ad@redhat.com>
Cc: Arnaldo Carvalho de Melo <293abb6b76d7791c0732cc517d38c4b5c734b87f@redhat.com>
Cc: Namhyung Kim <5c915a589b3ddf58cebf14bec41bcc143b37ac3c@kernel.org>
Cc: Corey Ashford <d8c6f216c17042adc228efa9f1d34ca50bd37e4b@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <e8a1bf9163cb25e93cfd6540f223b3872ea7ee55@gmail.com>
Cc: Paul Mackerras <19a0ba370c443ba08d20b5061586430ab449ee8c@samba.org>
Cc: Peter Zijlstra <645ca7d3a8d3d4f60557176cd361ea8351edc32b@chello.nl>
Cc: Stephane Eranian <f199ae9781930a5b94b284ca2f471140752002a7@google.com>
Cc: Vince Weaver <9b50d1f90e62bf2b07ce4a2c12ae735ccb4c3d05@deater.net>
Link: http://lkml.kernel.org/r/1359714225-4231-1-git-send-email-2c6594f608aa3d41e98d48846a6328831f7084ad@redhat.com
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>

KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs