tools/perf/tests/workloads/thloop.c

Source file repositories/reference/linux-study-clean/tools/perf/tests/workloads/thloop.c

File Facts

System
Linux kernel
Corpus path
tools/perf/tests/workloads/thloop.c
Extension
.c
Size
1565 bytes
Lines
83
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

if (ret) {
			fprintf(stderr, "Error: failed to create thread %d\n", i);
			done = 1; // Ensure started threads terminate.
			goto out;
		}
	}
	alarm(sec);
	test_loop();
	err = 0;
out:
	for (int i = 1; i < nt; i++) {
		if (thread_list && thread_list[i])
			pthread_join(thread_list[i], /*retval=*/NULL);
	}
	free(thread_list);
	return err;
}

DEFINE_WORKLOAD(thloop);

Annotation

Implementation Notes