tools/perf/util/parse-regs-options.c

Source file repositories/reference/linux-study-clean/tools/perf/util/parse-regs-options.c

File Facts

System
Linux kernel
Corpus path
tools/perf/util/parse-regs-options.c
Extension
.c
Size
2333 bytes
Lines
125
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 (!strcmp(s, "?")) {
			list_perf_regs(stderr, mask);
			goto error;
		}

		reg_mask = name_to_perf_reg_mask(s, mask);
		if (reg_mask == 0) {
			ui__warning("Unknown register \"%s\", check man page or run \"perf record %s?\"\n",
				s, intr ? "-I" : "--user-regs=");
			goto error;
		}
		*mode |= reg_mask;

		if (!p)
			break;

		s = p + 1;
	}
	ret = 0;

error:
	free(os);
	return ret;
}

int
parse_user_regs(const struct option *opt, const char *str, int unset)
{
	return __parse_regs(opt, str, unset, false);
}

int
parse_intr_regs(const struct option *opt, const char *str, int unset)
{
	return __parse_regs(opt, str, unset, true);
}

Annotation

Implementation Notes