A method for generating a profile of a target program executed by a target data processing apparatus , based on trace information captured during execution of the target program by the target data processing apparatus; the method comprising performing at least one profile updating operation, each profile updating operation comprising: identifying , based on at least one waypoint marker of said trace information indicating an outcome of a corresponding waypoint instruction of the target program, a next block of instructions executed by the target data processing apparatus during execution of the target program, wherein the waypoint instruction comprises an instruction having several alternative outcomes which affect which instructions are executed in the target program following the waypoint instruction; determining whether a target entry corresponding to said next block of instructions is present in a profile cache , the target entry specifying zero, one or more profile updating actions associated with the next block of instructions, wherein each entry of the profile cache corresponds to a block of instructions; when the target entry is present in the profile cache, updating the profile of the target program according to said zero, one or more profile updating actions specified by said target entry; and when the target entry is absent in the profile cache, determining zero, one or more profile updating actions for said next block of instructions based on an instruction-by-instruction representation of said target program, updating the profile of the target program based on said zero, one or more profile updating actions, and allocating an entry to the profile cache specifying said zero, one or more profile updating actions determined for said next block of instructions based on said instruction-by-instruction representation. identifying , based on at least one waypoint marker of said trace information indicating an outcome of a corresponding waypoint instruction of the target program, a next block of instructions executed by the target data processing apparatus during execution of the target program, wherein the waypoint instruction comprises an instruction having several alternative outcomes which affect which instructions are executed in the target program following the waypoint instruction; determining whether a target entry corresponding to said next block of instructions is present in a profile cache , the target entry specifying zero, one or more profile updating actions associated with the next block of instructions, wherein each entry of the profile cache corresponds to a block of instructions; when the target entry is present in the profile cache, updating the profile of the target program according to said zero, one or more profile updating actions specified by said target entry; and when the target entry is absent in the profile cache, determining zero, one or more profile updating actions for said next block of instructions based on an instruction-by-instruction representation of said target program, updating the profile of the target program based on said zero, one or more profile updating actions, and allocating an entry to the profile cache specifying said zero, one or more profile updating actions determined for said next block of instructions based on said instruction-by-instruction representation. <EOS>