The --switch-output command line argument for perf record allows some external control over the perf recording session. Such a test might contain a crafted tracee, that would signal perf with SIGUSR and check the perf.data* results after, i.e.
signal_perf();
do_some_load();
signal_perf();
do_some_other_load();
signal_perf();
If do_some_load() would be e.g. one third of do_some_other_load(), we might compare the records and verify that the second one brings more samples, etc. Please add this as a separate test script under base_record. TIA.