Re: using perf tool

2013-12-08 Thread Soham Chakraborty
Howdy,

You can annotate from within the perf report itself. What you have to do is
to take the perf record output. That will create a perf.data file. Now, run
perf archive. This will create a tarball.

Next, on the analyzing system (considering the output taken previously
needs to be examined on another system), copy over both the files. And then
as non-root run,

tar -zxvf filename.tar.bz2 ~/.debug

What this will do is that the unique build-ids corresponding to each ELF
image in the first system will be copied over to the new system (not
replacing but just plain copying for the purpose of analysis).

Now you run perf report on it and from inside of it, run annotate. It does
not need to be on the same kernel version or rather even, same hardware
architecture. It will run on whatever is there, x86_64, ARM, s390 etc.

Soham


On Sat, Dec 7, 2013 at 10:48 AM, Abu Rasheda  wrote:

> I figure out, it quite simple. Writing steps here, so it may be useful
> for someone in future.
>
> perf record -a
> ctrl-C when done collecting data
> copy kernel_module.ko to
> /lib/modules/2.6.32-71.el6.x86_64/kernel/net/ipv4/kernel_module.ko
> perf annotate function_name_in_kernel_module
>
> Since you compiled kernel module on this machine, perf can get path
> from the binary and locate the source. enjoy.
>
> On Fri, Dec 6, 2013 at 7:14 PM, Abu Rasheda  wrote:
> > Guys,
> >
> > I want to annotate Linux kernel module with c-source using perf tool.
> > Is it possible ? can someone points me to the instructions how to do
> > this ?
> >
> > Thanks
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Updating the kernel

2013-11-20 Thread Soham Chakraborty
Sure, sure - I do. I actually adore it ;)


On Wed, Nov 20, 2013 at 12:58 PM,  wrote:

> On Tue, 19 Nov 2013 15:39:06 -0500, Soham Chakraborty said:
> > Vladis, I hear ya and agree to that. Problem is I have seen big and by
> big,
> > I mean big infrastructures asking for ksplice since certain sales
> > people of certain company introduced them to the utopia that is called
> > downtime-less-patching-and-upgrading. And obviously, if you have worked
> > with the CLI a bit less than most of us have already had, you get the
> sweet
> > inclination to go with sales and you know, voila.
>
> Don't you just love when management makes decisions based on 8.5x11 color
> glossies? ;)
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Updating the kernel

2013-11-19 Thread Soham Chakraborty
Vladis, I hear ya and agree to that. Problem is I have seen big and by big,
I mean big infrastructures asking for ksplice since certain sales
people of certain company introduced them to the utopia that is called
downtime-less-patching-and-upgrading. And obviously, if you have worked
with the CLI a bit less than most of us have already had, you get the sweet
inclination to go with sales and you know, voila.


On Tue, Nov 19, 2013 at 2:16 PM,  wrote:

> On Tue, 19 Nov 2013 09:48:27 -0500, Soham Chakraborty said:
> > I don't really think ksplice has garnered much love from upstream.
>
> The most common word used upstream to describe ksplice is "bletcherous".
>
> The reason it's disliked is because it's a poor solution for the problem.
> Although ksplice-like technology was used for years to upgrade telco
> switches on the fly, that was motivated by two major factors:
>
> 1) Nobody at a telco wants to drop dial tone while a switch reboots.
> 2) Telco switches are building-sized and expensive, so HA failover wasn't a
> realistic option.
>
> Although the first is still an issue for many sites, there's little or no
> justification in 2013 for the second.
>
> If you're in the sort of environment where you really need the sort of
> uptime
> that drive you to consider ksplice, you *really* should be doing load
> balancing and HA failover with heartbeats - that will not only allow you
> to actually reboot each server cleanly, but *also* protect you against
> blown
> DIMMs, crashed system disks, and all the *other* whoopsies that can cost
> you one or two nine's of reliability.
>
> Seriously - if you can't afford the downtime to reboot, youy can't afford
> *NOT* to be doing a full HA configuration - and possibly looking at
> geographic separation of the hot failover site.
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Updating the kernel

2013-11-19 Thread Soham Chakraborty
I don't really think ksplice has garnered much love from upstream. I for
one, know that rpm based distros don't support it.

Soham


On Tue, Nov 19, 2013 at 12:52 AM, Mandeep Sandhu <
mandeepsandhu@gmail.com> wrote:

> Yes, Ksplice offers this feature. Though check with them if your
> specific distro is supported. Or if you're compiling your own kernel
> then I guess you'll have to send them the new image which they convert
> to a reboot-less image which can be applied to a running system.
>
> -mandeep
>
> On Tue, Nov 19, 2013 at 10:55 AM, Shraddha Kamat 
> wrote:
> > Is it possible to keep the kernel updated to upstream without ever
> > rebooting the system ? Ksplice ??
> >
> > Regards,
> > Shraddha
> >
> >
> > ___
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Why would some process swap in place of reclaiming free(cached) memory

2013-02-20 Thread Soham Chakraborty
On Thu, Feb 21, 2013 at 10:45 AM, Mandeep Sandhu <
mandeepsandhu@gmail.com> wrote:

> > I know the pages are kept on disk initially and then swapped in as
> needed/referenced.  Thus if there are code pages where none of the code in
> the page has been executed since starting the app, then that page will
> remain on disk until the application logic eventually invokes it.  At that
> point it will be demand loaded from disk.
> >
> > During that early stage, do the never used pages show as swapped out?
>  If so, why would anyone want all those never used pages to be brought into
> ram just to sit there unused?
>
> Are you saying that pages of code segment (of an executable) which
> have not been accessed yet, are copied onto the swap space from their
> location on the disk when the program is exec'ed? Or do they remain on
> disk (in their original location) and loaded into memory only when
> accessed (and _then_ possibly swapped out)? If they remain on disk,
> then that wouldn't show up in swap space, right?
>

If the code segment of an executable which hasn't been accessed, they will
remain on disk because they have fixed filesystem backing. Only when they
are referenced, they will go to cache and then when inactive and/or while
reclaiming, they will end up in disk again. But, afaik, anything which has
a filesystem backing, a fixed storage backing, doesn't go to swap. This
part is pretty clear to me. Only anon pages go to swap and something which
is on disk, is not anon in first place.

Soham

>
> -mandeep
>
> >
> > The end result is that that swap'ed pages represent pages available to
> be swapped in, but not the number of pages that were actually swapped out
> at some point in time.
> >
> > Greg
> > --
> > Sent from my Android phone with K-9 Mail. Please excuse my brevity.
> >
> > ___
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Why would some process swap in place of reclaiming free(cached) memory

2013-02-20 Thread Soham Chakraborty
Hi all,

I posted this question in linux-mm list as well but it didn't spawn much
interest. So, I am putting the same question here also. Would love if
someone can put some traction.

The question is salivating and simple. When we have free and lotsa cached
memory in a system (irrespective of distro and kernel), why would some
process end up in swap space, I understand the overcommit mode of vm, the
default value of 0 and what it does. I also know that the cache might be
dirty and we don't might not want to allocate free pages thinking that we
might go under the watermark of low. But, I mainly end up getting this
question from end users - why would things swap if I have free memory. I
guess, technically we can't stop swapping even if we set vm.swappiness to 0
but well, I think I have said what I need to said. If you need data, I can
provide those.

Any reference to source where it gives the condition to transfer some pages
to swap, despite of having free memory, would be highly appreciated. I
tried to find in mm/vmscan.c but didn't get much success.

Soham
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies