public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Re: What about MIPS support?
@ 2012-08-22 20:04 Victor Kamensky
  2012-08-23  2:23 ` Maneesh Soni
  2012-08-23 22:11 ` Josh Stone
  0 siblings, 2 replies; 12+ messages in thread
From: Victor Kamensky @ 2012-08-22 20:04 UTC (permalink / raw)
  To: systemtap, Josh Stone, Per Hallsmark; +Cc: Maneesh Soni, Wade Farnsworth

Hi Per, Josh,

We (Cisco) have pretty much full systemtap MIPS port. It works fine on 
Cavium Octeon cpus (mips64). We did very limited testing on OpenWrt 
Broadcom 4710 (in order to cover mips32 variant).

All parts, kernel and user land, are covered and we have almost all CPU 
specific systemtap functions implemented.

Also we had faced bunch of cross compilation related issues and we have
quite extensive patch addressing those.

Maneesh Soni developed mips uprobes and I did all other pieces (mips 
run-time, mips .stp files, cross compile, etc).

We always meant to publish all of it, but never get our hands on it. I 
hope this thread would be final push :). We will do it. Unfortunately, I 
cannot publish our patch series right away. I need to get permission from 
our company legal. It should not be a problem, but it may take two or 
three weeks.

Our latest series of patches is based on systemtap-1.6. I'll see whether I
can find time and move them to latest git ... In worst case scenario we 
just publish what we have.

Wrt of MIPS kprobes, it should be there already, somewhere in latest 
kernel. Most of support was there for a while. Maneesh and I contributed 
patch that let probe be inserted into jump instructions (that was 
limitation of original implementation, which we quickly discovered when we 
used for real cases). We worked on top 2.6.32 kernel. As understand there 
is current gradual departure from uprobes .. so our mips uprobes part may 
need rework a bit.

Thanks,
Victor

On 08/17/2012 Josh Stone wrote:

> On 08/17/2012 09:32 AM, Hallsmark, Per wrote:
> > Dear systemtap gurus,
> > 
> > Are there any plans in near future for a MIPS port?
> 
> I don't know of any plans, but we'll welcome patches. :)
> 
> > I've also tried a bit with release 1.7 (latest release possible that 
> > didn't require a lot of changes in our build environment, like 
> > upgrading elfutils etc). Unfortunately our kernel didn't have
> > support for kprobes so that had to be backported.
> 
> We'll of course prefer that any patches are on git master. Perhaps you
> can configure --with-elfutils=/path/to/new/elfutils to build stap with
> its own copy.  Anything else in your build environment holding you back?
> 
> > So I obviously now need to add more mips support in systemtap 
> > (started with this in tapsets/mips etc)
> > 
> > Any guidance on what is needed todo for a new arch?
> 
> Right, there will need to be tapset/$arch for specific functions, and
> now some of that is split into tapset/linux/$arch too.
> 
> Then runtime/loc2c-runtime.h also has a lot of arch-specific code that
> you'll need to fill in for mips, in order to do any register or memory
> access in your probes.
> 
> Those are the biggies I can think of, but smaller stuff may also be
> sprinkled about.  For instance, if you want process.mark probes (SDT),
> there's a tiny bit of arch #ifdefs in sdt.h, and then tapsets.cxx
> sdt_uprobe_var_expanding_visitor::visit_target_symbol_arg() will need to
> learn mips too.
> 
> Wade Farnsworth might be able to identify more points, as he's been
> working to get ARM support in shape.  It would be nice to start a
> porting guide on our wiki for these things.
> 
> > Anyone started already with mips?
> 
> Just you, afaik. ;)
> 
> 
> Josh

^ permalink raw reply	[flat|nested] 12+ messages in thread
* What about MIPS support?
@ 2012-08-17 16:33 Hallsmark, Per
  2012-08-18  2:20 ` Josh Stone
  0 siblings, 1 reply; 12+ messages in thread
From: Hallsmark, Per @ 2012-08-17 16:33 UTC (permalink / raw)
  To: systemtap

Dear systemtap gurus,

Are there any plans in near future for a MIPS port?

Even in the latest git repo I didn't find any support for this.
In the maillist archive I couldn't search up anything vital either
so there this question.

I've also tried a bit with release 1.7 (latest release possible
that didn't require a lot of changes in our build environment,
like upgrading elfutils etc). Unfortunately our kernel didn't have
support for kprobes so that had to be backported.

As we mostly do crosscompile, I've used same manner as
in http://www.omappedia.org/wiki/Systemtap for building the
stap kernel modules on a host and later running them in target
via staprun.

I can run simplier stuff like:


[phallsma@arn-ph-lap systemtap]$ cat hello_world.stp 
probe begin {
	log("hello world")
	exit()
}
[phallsma@arn-ph-lap systemtap]$ 

[phallsma@arn-ph-lap systemtap]$ make module-hello_world
Building module hello_world
/../stap -g -a mips -B CROSS_COMPILE=mips-wrs-linux-gnu- -p 4 -r /../linux-standard-build -m hello_world hello_world.stp
hello_world.ko
[phallsma@arn-ph-lap systemtap]$ 

And then in target:

root@localhost:/root> staprun hello_world.ko 
hello world
root@localhost:/root> 

However, when I know try something more fun it fails:

[phallsma@arn-ph-lap systemtap]$ cat pid.stp 
probe syscall.* {
	if (target()==pid())
		log(name." ".argstr)
}
[phallsma@arn-ph-lap systemtap]$

[phallsma@arn-ph-lap systemtap]$ make module-pid
Building module pid
/../stap -g -a mips -B CROSS_COMPILE=mips-wrs-linux-gnu- -p 4 -r /../linux-standard-build -m pid pid.stp
semantic error: unresolved arity-4 function: identifier '_arch_ptrace_argstr' at /../systemtap/systemtap-1.7-host/share/systemtap/tapset/aux_syscalls.stp:2234:9
        source: 	retval=_arch_ptrace_argstr(request, pid, addr, data)
                	       ^
WARNING: cannot find module /home/phallsma/.systemtap/cache/56/typequery_5669672d94d9763ecb1a5f26f11313ad_1198.ko debuginfo: no support library found for machine
Pass 2: analysis failed.  Try again with another '--vp 01' option.
make: *** [module-pid] Error 1
[phallsma@arn-ph-lap systemtap]$

So I obviously now need to add more mips support in systemtap (started with this in tapsets/mips etc)

Any guidance on what is needed todo for a new arch?

Anyone started already with mips?

BR,
Per


--
Per Hallsmark                      per.hallsmark@windriver.com
Engineering Specialist        Wind River AB
Mobile: +46733249340       Office: +46859461127
Torshamnsgatan 27            164 40 Kista

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-08-06 13:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-22 20:04 What about MIPS support? Victor Kamensky
2012-08-23  2:23 ` Maneesh Soni
2012-08-23 14:33   ` Ananth N Mavinakayanahalli
2012-08-23 22:11 ` Josh Stone
2012-10-15 21:21   ` Victor Kamensky
2012-10-23 23:43     ` Josh Stone
2015-08-05 12:42     ` William Cohen
     [not found]       ` <CAJdmCr+1s6JLW3DsGxbdqPcpnD1+wNo5VwAifm6UN-SWE+PKmw@mail.gmail.com>
2015-08-05 16:25         ` William Cohen
     [not found]           ` <CAJdmCrLN3w6J3XHTCx0uMDQDAc6LB+5qC3o7Rr+KABAriwNATg@mail.gmail.com>
2015-08-06  1:30             ` William Cohen
2015-08-06 13:04               ` William Cohen
  -- strict thread matches above, loose matches on Subject: below --
2012-08-17 16:33 Hallsmark, Per
2012-08-18  2:20 ` Josh Stone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).