|
45 | 45 | static int pt_blk_proceed_trailing_event(struct pt_block_decoder *,
|
46 | 46 | struct pt_block *);
|
47 | 47 |
|
| 48 | +static int pt_blk_proceed_no_event_cached(struct pt_block_decoder *decoder, |
| 49 | + struct pt_block *block, |
| 50 | + struct pt_block_cache *bcache, |
| 51 | + const struct pt_mapped_section *msec); |
48 | 52 | static int pt_blk_set_trig_anchor(struct pt_block_decoder *decoder)
|
49 | 53 | {
|
50 | 54 | if (!decoder)
|
@@ -2249,6 +2253,7 @@ pt_blk_proceed_no_event_fill_cache(struct pt_block_decoder *decoder,
|
2249 | 2253 | uint64_t nip, dip, ioff, noff;
|
2250 | 2254 | int64_t disp;
|
2251 | 2255 | int status;
|
| 2256 | + int fill_block; |
2252 | 2257 |
|
2253 | 2258 | if (!decoder || !steps)
|
2254 | 2259 | return -pte_internal;
|
@@ -2431,6 +2436,8 @@ pt_blk_proceed_no_event_fill_cache(struct pt_block_decoder *decoder,
|
2431 | 2436 | if (status < 0)
|
2432 | 2437 | return status;
|
2433 | 2438 |
|
| 2439 | + |
| 2440 | + fill_block = pt_bce_is_valid(bce); |
2434 | 2441 | /* If we don't have a valid cache entry, yet, fill the cache some more.
|
2435 | 2442 | *
|
2436 | 2443 | * On our way back, we add a cache entry for this instruction based on
|
@@ -2515,7 +2522,18 @@ pt_blk_proceed_no_event_fill_cache(struct pt_block_decoder *decoder,
|
2515 | 2522 | * Cache updates are atomic so even if the two versions were not
|
2516 | 2523 | * identical, we wouldn't care because they are both correct.
|
2517 | 2524 | */
|
2518 |
| - return pt_bcache_add(bcache, ioff, bce); |
| 2525 | + status = pt_bcache_add(bcache, ioff, bce); |
| 2526 | + if (status < 0) |
| 2527 | + return status; |
| 2528 | + |
| 2529 | + /* After we fill a new cache entry, we also need to update the block |
| 2530 | + * with that entry. |
| 2531 | + */ |
| 2532 | + if (fill_block) |
| 2533 | + return pt_blk_proceed_no_event_cached(decoder, block, |
| 2534 | + bcache, msec); |
| 2535 | + |
| 2536 | + return status; |
2519 | 2537 | }
|
2520 | 2538 |
|
2521 | 2539 | /* Proceed at a potentially truncated instruction.
|
|
0 commit comments