Re: [PATCH 10/24] x86/oprofile: Add IBS support for AMD CPUs, IBSbuffer handling routines

From: Ingo Molnar
Date: Sat Jul 26 2008 - 05:58:56 EST



* Robert Richter <robert.richter@xxxxxxx> wrote:

> @@ -272,7 +273,7 @@ static void increment_tail(struct oprofile_cpu_buffer *b)
> {
> unsigned long new_tail = b->tail_pos + 1;
>
> - rmb();
> + rmb(); /* be sure fifo pointers are synchromized */

ignore my previous mail :-)

> + if (ibs_code == IBS_OP_BEGIN) {
> + add_sample(cpu_buf, ibs[6], ibs[7]);
> + add_sample(cpu_buf, ibs[8], ibs[9]);
> + add_sample(cpu_buf, ibs[10], ibs[11]);
> + }

style problem.

> + int is_kernel = !user_mode(regs);
> + unsigned long pc = profile_pc(regs);
> +
> + struct oprofile_cpu_buffer *cpu_buf =
> + &per_cpu(cpu_buffer, smp_processor_id());

please dont put newlines in the middle of variable definitions.

> /* transient events for the CPU buffer -> event buffer */
> #define CPU_IS_KERNEL 1
> #define CPU_TRACE_BEGIN 2
> +#define IBS_FETCH_BEGIN 3
> +#define IBS_OP_BEGIN 4

vertical alignment would help readability i guess. Plus use an enum
instead of a macro.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/