[prev in list] [next in list] [prev in thread] [next in thread] 

List:       oprofile-list
Subject:    Re: question about prep_ jitdump in opcontrol
From:       Myke Smith <Myke.Smith () palm ! com>
Date:       2010-01-22 13:36:41
Message-ID: 31D094F4-6BA5-41DE-9AD8-50B5B6F14F3D () palm ! com
[Download RAW message or body]

Daniel,

Thanks now I understand that this is to cover the re-boot case, so my  
work-around for the lack of an -lname option in BusyBox has that  
possible hole. I will document that in my local patch.

thanks

-myke

On Jan 22, 2010, at 3:02 AM, Daniel Hansel wrote:

> Hi Myke,
>
> the option "-lname" checks the symbolic link content for a special  
> pattern (i.e. the linked file name).
> This is necessary to check if the dump file is in use by the process  
> with the same PID.
>
> For example, if you use Oprofile to profile a Java application  
> Oprofile would create a dump file using the PID of the Java app.  
> process (e.g. pid=1000).
> If you reboot your machine without resetting the Oprofile data the  
> dump files would not be deleted.
> After that reboot the PID counter is restarted.
> Now you could get a new process with the PID 1000 used by the last  
> Oprofile run. But this new process is not using the dump file.
> In that case the check should delete the dump file due to the fact  
> that it is not used by the process with the PID 1000.
>
> The find option "-lname" is used for that.
>
> Kind regards,
> Daniel
>
> p.s.: Sorry for my late answer. I was very busy during this week.
>
> Myke Smith wrote:
>>
>> Daniel,
>>
>> Any comments on this change? Am I missing something fundamental in  
>> why
>> you need to check for the file by -lname?
>>
>> To get around -lname in BusyBox I was going to simply do:
>>
>>    # VMs may already be running when profiling is started, so
>>    # remove only dump files that are not in use
>>    for I in $dumpdir/*; do
>>        test -f $I || continue;
>>        local pid=`basename $I .dump`;
>>        if  ! test -d /proc/$pid; then
>>            rm -f $I;
>>        fi
>>
>>
>> thank you,
>>
>> -myke
>>
>> On Jan 7, 2010, at 5:12 AM, Maynard Johnson wrote:
>>
>>> Myke Smith wrote:
>>>> Hello,
>>>>
>>>> I have encountered a problem in prep_jitdump which is due to the
>>>> limited implementation of "find" in busybox.
>>>>
>>>>>    # VMs may already be running when profiling is started, so
>>>>>    # remove only dump files that are not in use
>>>>>    for I in $dumpdir/*; do
>>>>>        test -f $I || continue;
>>>>>        local pid=`basename $I .dump`;
>>>>>        if test -d /proc/$pid; then
>>>>>            local files=`find /proc/$pid/fd -lname $I`;
>>>>>            test -n "$files" && continue;
>>>>>        fi
>>>>>        rm -f $I;
>>>>>
>>>>
>>>> In busybox, the option "-lname" is not supported. My question,  
>>>> after
>>>> looking at the code, is why is it necessary to do all of this?  
>>>> Isn't
>>>> it sufficient to see that the pid is still defined in /proc and  
>>>> if not
>>>> remove the file from $dumpdir?
>>> Daniel, you are probably the best person to answer this question  
>>> since
>>> you committed this change.
>>>
>>> -Maynard
>>>>
>>>> thanks,
>>>>
>>>> -myke
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>> This SF.Net email is sponsored by the Verizon Developer Community
>>>> Take advantage of Verizon's best-in-class app development support
>>>> A streamlined, 14 day to market process makes app distribution fast
>>>> and easy
>>>> Join now and get one step closer to millions of Verizon customers
>>>> http://p.sf.net/sfu/verizon-dev2dev
>>>> _______________________________________________
>>>> oprofile-list mailing list
>>>> oprofile-list@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>>
>>
>


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
oprofile-list mailing list
oprofile-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic