lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 6 Aug 2015 17:44:25 +0000
From:	"Liang, Kan" <kan.liang@...el.com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	Andy Lutomirski <luto@...capital.net>,
	Thomas Gleixner <tglx@...utronix.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	"Andrew Lutomirski" <luto@...nel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Ingo Molnar <mingo@...nel.org>,
	"linux-tip-commits@...r.kernel.org" 
	<linux-tip-commits@...r.kernel.org>
Subject: RE: [tip:perf/core] perf/x86: Add an MSR PMU driver



> +	/* Probe the MSRs. */
> +	for (i = PERF_MSR_TSC + 1; i < PERF_MSR_EVENT_MAX; i++) {
> +		u64 val;
> 
> -	default:
> -		err = -ENOTSUPP;
> +		if (!msr[i].test() || rdmsrl_safe(msr[i].msr, &val))
> +			msr[i].attr = NULL;
>  	}
> 
> -	if (err != 0) {
> -		pr_cont("no msr PMU driver.\n");
> -		return 0;
> +	/* List remaining MSRs in the sysfs attrs. */
> +	for (i = 0; i < PERF_MSR_EVENT_MAX; i++) {

i should start from PERF_MSR_TSC + 1. The tsc has already been
inserted into events_attrs by default.

> +		if (msr[i].attr)
> +			events_attrs[j++] = &msr[i].attr->attr.attr;
>  	}
> +	events_attrs[j] = NULL;
> 
>  	perf_pmu_register(&pmu_msr, "msr", -1);
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ