diff mbox

[02/10] x86: pmu: report takes a fmt

Message ID 1418400377-17388-3-git-send-email-drjones@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Jones Dec. 12, 2014, 4:06 p.m. UTC
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 x86/pmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Paolo Bonzini Dec. 15, 2014, 3:03 p.m. UTC | #1
On 12/12/2014 17:06, Andrew Jones wrote:
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  x86/pmu.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/x86/pmu.c b/x86/pmu.c
> index 5c85146810cb1..f116bafebf424 100644
> --- a/x86/pmu.c
> +++ b/x86/pmu.c
> @@ -228,14 +228,12 @@ static void check_gp_counter(struct pmu_event *evt)
>  		.ctr = MSR_IA32_PERFCTR0,
>  		.config = EVNTSEL_OS | EVNTSEL_USR | evt->unit_sel,
>  	};
> -	char fmt[100];
>  	int i;
>  
>  	for (i = 0; i < num_counters; i++, cnt.ctr++) {
>  		cnt.count = 0;
>  		measure(&cnt, 1);
> -		snprintf(fmt, sizeof(fmt), "%s-%%d", evt->name);
> -		report(fmt, verify_event(cnt.count, evt), i);
> +		report("%s-%%d", verify_event(cnt.count, evt), evt->name, i);

Should be %s-%d, changed it.

Paolo

>  	}
>  }
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paolo Bonzini Dec. 15, 2014, 3:03 p.m. UTC | #2
On 12/12/2014 17:06, Andrew Jones wrote:
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  x86/pmu.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/x86/pmu.c b/x86/pmu.c
> index 5c85146810cb1..f116bafebf424 100644
> --- a/x86/pmu.c
> +++ b/x86/pmu.c
> @@ -228,14 +228,12 @@ static void check_gp_counter(struct pmu_event *evt)
>  		.ctr = MSR_IA32_PERFCTR0,
>  		.config = EVNTSEL_OS | EVNTSEL_USR | evt->unit_sel,
>  	};
> -	char fmt[100];
>  	int i;
>  
>  	for (i = 0; i < num_counters; i++, cnt.ctr++) {
>  		cnt.count = 0;
>  		measure(&cnt, 1);
> -		snprintf(fmt, sizeof(fmt), "%s-%%d", evt->name);
> -		report(fmt, verify_event(cnt.count, evt), i);
> +		report("%s-%%d", verify_event(cnt.count, evt), evt->name, i);

Should be %s-%d, changed it.

Paolo

>  	}
>  }
>  
> 
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/x86/pmu.c b/x86/pmu.c
index 5c85146810cb1..f116bafebf424 100644
--- a/x86/pmu.c
+++ b/x86/pmu.c
@@ -228,14 +228,12 @@  static void check_gp_counter(struct pmu_event *evt)
 		.ctr = MSR_IA32_PERFCTR0,
 		.config = EVNTSEL_OS | EVNTSEL_USR | evt->unit_sel,
 	};
-	char fmt[100];
 	int i;
 
 	for (i = 0; i < num_counters; i++, cnt.ctr++) {
 		cnt.count = 0;
 		measure(&cnt, 1);
-		snprintf(fmt, sizeof(fmt), "%s-%%d", evt->name);
-		report(fmt, verify_event(cnt.count, evt), i);
+		report("%s-%%d", verify_event(cnt.count, evt), evt->name, i);
 	}
 }