comparison src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @ 10405:f2110083203d

8005849: JEP 167: Event-Based JVM Tracing Reviewed-by: acorn, coleenp, sla Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
author sla
date Mon, 10 Jun 2013 11:30:51 +0200
parents 746b070f5022
children 980532a806a5 5e3b6f79d280
comparison
equal deleted inserted replaced
10404:d0add7016434 10405:f2110083203d
1 /* 1 /*
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
192 intptr_t* os::Solaris::ucontext_get_fp(ucontext_t *uc) { 192 intptr_t* os::Solaris::ucontext_get_fp(ucontext_t *uc) {
193 ShouldNotReachHere(); 193 ShouldNotReachHere();
194 return NULL; 194 return NULL;
195 } 195 }
196 196
197 address os::Solaris::ucontext_get_pc(ucontext_t *uc) {
198 return (address) uc->uc_mcontext.gregs[REG_PC];
199 }
200
201
197 // For Forte Analyzer AsyncGetCallTrace profiling support - thread 202 // For Forte Analyzer AsyncGetCallTrace profiling support - thread
198 // is currently interrupted by SIGPROF. 203 // is currently interrupted by SIGPROF.
199 // 204 //
200 // ret_fp parameter is only used by Solaris X86. 205 // ret_fp parameter is only used by Solaris X86.
201 // 206 //
263 } else { 268 } else {
264 return os::get_sender_for_C_frame(&myframe); 269 return os::get_sender_for_C_frame(&myframe);
265 } 270 }
266 } 271 }
267 272
268
269 void GetThreadPC_Callback::execute(OSThread::InterruptArguments *args) {
270 Thread* thread = args->thread();
271 ucontext_t* uc = args->ucontext();
272 intptr_t* sp;
273
274 assert(ProfileVM && thread->is_VM_thread(), "just checking");
275
276 // Skip the mcontext corruption verification. If if occasionally
277 // things get corrupt, it is ok for profiling - we will just get an unresolved
278 // function name
279 ExtendedPC new_addr((address)uc->uc_mcontext.gregs[REG_PC]);
280 _addr = new_addr;
281 }
282
283
284 static int threadgetstate(thread_t tid, int *flags, lwpid_t *lwp, stack_t *ss, gregset_t rs, lwpstatus_t *lwpstatus) { 273 static int threadgetstate(thread_t tid, int *flags, lwpid_t *lwp, stack_t *ss, gregset_t rs, lwpstatus_t *lwpstatus) {
285 char lwpstatusfile[PROCFILE_LENGTH]; 274 char lwpstatusfile[PROCFILE_LENGTH];
286 int lwpfd, err; 275 int lwpfd, err;
287 276
288 if (err = os::Solaris::thr_getstate(tid, flags, lwp, ss, rs)) 277 if (err = os::Solaris::thr_getstate(tid, flags, lwp, ss, rs))
356 } 345 }
357 346
358 guarantee(sig != os::Solaris::SIGinterrupt(), "Can not chain VM interrupt signal, try -XX:+UseAltSigs"); 347 guarantee(sig != os::Solaris::SIGinterrupt(), "Can not chain VM interrupt signal, try -XX:+UseAltSigs");
359 348
360 if (sig == os::Solaris::SIGasync()) { 349 if (sig == os::Solaris::SIGasync()) {
361 if (thread) { 350 if (thread || vmthread) {
362 OSThread::InterruptArguments args(thread, uc); 351 OSThread::SR_handler(t, uc);
363 thread->osthread()->do_interrupt_callbacks_at_interrupt(&args);
364 return true;
365 } else if (vmthread) {
366 OSThread::InterruptArguments args(vmthread, uc);
367 vmthread->osthread()->do_interrupt_callbacks_at_interrupt(&args);
368 return true; 352 return true;
369 } else if (os::Solaris::chained_handler(sig, info, ucVoid)) { 353 } else if (os::Solaris::chained_handler(sig, info, ucVoid)) {
370 return true; 354 return true;
371 } else { 355 } else {
372 // If os::Solaris::SIGasync not chained, and this is a non-vm and 356 // If os::Solaris::SIGasync not chained, and this is a non-vm and