A new diagnostic has been developed to investigate the wave-particle interaction in the phase-space in gyrokinetic particle-in-cell codes. Based on the projection of energy transfer terms onto the velocity space, the technique has been implemented and tested in the global code ORB5 and it gives an opportunity to localise velocity domains of maximum wave-plasma energy exchange for separate species. Moreover, contribution of different species and resonances can be estimated as well, by integrating the energy transfer terms in corresponding velocity domains. This Mode-Plasma-Resonance (MPR) diagnostic has been applied to study the dynamics of the Energetic-particle-induced Geodesic Acoustic Modes (EGAMs) in an ASDEX Upgrade shot, by analysing the influence of different species on the mode time evolution.Since the equations on which the diagnostic is based, are valid in both linear and nonlinear cases, this approach can be applied to study nonlinear plasma effects. As a possible future application, the technique can be used, for instance, to investigate the nonlinear EGAM frequency chirping, or the plasma heating due to the damping of the EGAMs.