Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tracecompass-dev] Question about importing a multi-cpu perf capture in TraceCompass

Hi Matthew,

 

Thanks a lot for your patch proposal !

 

I've done 2 changes to make it working fine with my trace as following with comment //

 

public class CtfCpuAspect extends TmfCpuAspect {

 

    @Override

    public Integer resolve(ITmfEvent event) {

        if (!(event instanceof CtfTmfEvent)) {

            return null;

        }

        int cpu = ((CtfTmfEvent) event).getCPU();

        //if (cpu == 0) {

        if (cpu == -1) {

            final ITmfEventField field = event.getContent().getField("perf_cpu");

            if (field != null) {

                final Object value = field.getValue();

                if (value instanceof Long) {

                    //cpu = (int) value;

                    cpu=((Long) value).intValue();

                }

            }

        }

        return cpu;

    }

}

 

I’ll look how to provide you with a trace for your tests through a bugzilla, so you could test with it before submitting the patch.

 

Thanks again !

 

Incidentally, does exist a way to create a hierarchy by CPU in the “Control Flow” view ?

 

BR,

  Jerome

 

 

-----Original Message-----
From: tracecompass-dev-bounces@xxxxxxxxxxx [mailto:tracecompass-dev-bounces@xxxxxxxxxxx] On Behalf Of Matthew Khouzam
Sent: Friday, December 18, 2015 9:51 PM
To: tracecompass-dev@xxxxxxxxxxx
Subject: Re: [tracecompass-dev] Question about importing a multi-cpu perf capture in TraceCompass

 

Jerome, could you try to change the file CtfCpuAspect.java in tmf.ctf.core to this

 

/*******************************************************************************

* Copyright (c) 2014, 2015 Ericsson

*

* All rights reserved. This program and the accompanying materials are

* made available under the terms of the Eclipse Public License v1.0 which

* accompanies this distribution, and is available at

* http://www.eclipse.org/legal/epl-v10.html

*

* Contributors:

*   Alexandre Montplaisir - Initial API and implementation

*******************************************************************************/

 

package org.eclipse.tracecompass.tmf.ctf.core.event.aspect;

 

import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;

import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;

import org.eclipse.tracecompass.tmf.core.event.aspect.TmfCpuAspect;

import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;

 

/**

* "CPU" event aspect for CTF traces.

*

* @author Alexandre Montplaisir

*/

public class CtfCpuAspect extends TmfCpuAspect {

 

    @Override

    public Integer resolve(ITmfEvent event) {

        if (!(event instanceof CtfTmfEvent)) {

            return null;

        }

        int cpu = ((CtfTmfEvent) event).getCPU();

        if (cpu == 0) {

            final ITmfEventField field = event.getContent().getField("perf_cpu");

            if (field != null) {

                final Object value = field.getValue();

                if (value instanceof Long) {

                    cpu = (int) value;

                }

            }

        }

        return cpu;

    }

}

 

 

It seems to work here. I want to confirm before productifying the patch.

 

On 15-12-18 09:46 AM, Jerome CORRENOZ wrote:

> 

> Hi,

> 

> 

> I’m starting to use TraceCompass to import a perf trace.

> 

> 

> I have a problem with multi-CPU. Indeed, the trace has been captured

> on a multi-CPU but all the events seem to be associated to CPU0 (see

> the table view, column “CPU”) whereas the “Contents” correctly

> contains the “perf_cpu=X”. This impacts the “Resources” view where

> only CPU0 is displayed but mainly the “Control Flow” view.

> 

> 

> I’m using:

> 

> -    perf 4.1.1 on ARMv7

> 

> -    TraceCompass 1.1.0

> 

> 

> Doing the following:

> 

> 

> #perf record –e ‘sched :*’ –a

> 

> #perf data convert –to-ctf=./ctf

> 

> Then Open the ctf file (called perf_stream_0) in TraceCompass

> 

> 

> Any ideas about the cause of it ?

> 

> 

> BR,

> 

>   Jerome

> 

> 

> 

> 

> 

> _______________________________________________

> tracecompass-dev mailing list

> tracecompass-dev@xxxxxxxxxxx

> To change your delivery options, retrieve your password, or

> unsubscribe from this list, visit

> https://dev.eclipse.org/mailman/listinfo/tracecompass-dev

 

_______________________________________________

tracecompass-dev mailing list

tracecompass-dev@xxxxxxxxxxx

To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/tracecompass-dev


Back to the top