@@ -1055,16 +1055,16 @@ bool linux_launchmon_t::handle_mpir_variables(
10551055 p.set_launch_hidden_bp (NULL );
10561056 }
10571057 la_bp = new linux_breakpoint_t ();
1058- la_bp->set_address_at (launch_bp_sym.get_relocated_address ());
1058+ la_bp->set_address_at (launch_bp_sym.get_relocated_lowest_address ());
10591059
10601060#if PPC_ARCHITECTURE
10611061 //
10621062 // DHA Mar 05 2009
10631063 // PowerPC Linux has begun to change the linking convention
10641064 // such that binaries no longer export direct function
10651065 // symbols. (e.g., .MPIR_Breakpoint). But rather, undotted
1066- // global data symbols (e.g., MPIR_Breakpoint) contains the
1067- // address for the corresponding function.
1066+ // global data symbols (e.g., MPIR_Breakpoint) is the function
1067+ // descriptor
10681068 //
10691069 // Added indirect breakpoint support for that and use this
10701070 // method on all PPC systems across the board including
@@ -1486,16 +1486,15 @@ launchmon_event_e linux_launchmon_t::decipher_an_event(
14861486 //
14871487 // Parent gets SIGTRAP when a new thread is created
14881488 // Used to be: return_ev = LM_STOP_NOT_INTERESTED;
1489- int upper16;
1490- upper16 = event.get_rawstatus () >> 16 ;
1491- if (upper16 == LINUX_TRACER_EVENT_CLONE) {
1489+ int high = event.get_rawstatus () >> 8 ;
1490+ if (high == (SIGTRAP | (LINUX_TRACER_EVENT_CLONE << 8 ))) {
14921491 return_ev = LM_STOP_AT_THREAD_CREATION;
1493- } else {
1494- //
1495- // SIGTRAP due to fork for example
1496- //
1497- return_ev = LM_STOP_NOT_INTERESTED;
1498- }
1492+ } else {
1493+ //
1494+ // SIGTRAP due to fork for example
1495+ //
1496+ return_ev = LM_STOP_NOT_INTERESTED;
1497+ }
14991498 } else if (event.get_signum () == SIGSTOP) {
15001499 return_ev = LM_RELAY_SIGNAL;
15011500
@@ -1578,12 +1577,13 @@ launchmon_rc_e linux_launchmon_t::handle_trap_after_attach_event(
15781577
15791578#if MEASURE_TRACING_COST
15801579 beginTS = gettimeofdayD ();
1580+ #endif
1581+
15811582 {
1582- self_trace_t::trace (true , // print always
1583+ self_trace_t::trace (LEVELCHK (level2),
15831584 MODULENAME, 0 ,
15841585 " The RM process has just been trapped due to attach" );
15851586 }
1586- #endif
15871587
15881588 bool use_cxt = true ;
15891589 image_base_t <T_VA, elf_wrapper> *dynloader_im = NULL ;
@@ -1649,7 +1649,7 @@ launchmon_rc_e linux_launchmon_t::handle_trap_after_attach_event(
16491649 dynloader_im->get_a_symbol (p.get_loader_breakpoint_sym ());
16501650
16511651 lo_bp = new linux_breakpoint_t ();
1652- addr_dl_bp = dynload_sym.get_relocated_address ();
1652+ addr_dl_bp = dynload_sym.get_relocated_lowest_address ();
16531653 lo_bp->set_address_at (addr_dl_bp);
16541654#if PPC_ARCHITECTURE
16551655 lo_bp->set_use_indirection ();
@@ -1682,7 +1682,14 @@ launchmon_rc_e linux_launchmon_t::handle_trap_after_attach_event(
16821682 get_tracer ()->tracer_continue (p, use_cxt);
16831683 int fifofd = 0 ;
16841684 if ((fifofd = open (fifopathbuf, O_WRONLY)) >= 0 ) {
1685+ #if POWERLE_ARCHITECTURE
1686+ char wakeup = ' 1' ;
1687+ self_trace_t::trace (
1688+ true , MODULENAME, 0 ,
1689+ " Warning: Sending ASCII 1 to FIFO to work around a jsrun bug" );
1690+ #else
16851691 char wakeup = (char )1 ;
1692+ #endif
16861693 if (lmon_write_raw (fifofd, &wakeup, 1 ) != 1 ) {
16871694 self_trace_t::trace (
16881695 true , MODULENAME, 0 ,
@@ -1781,9 +1788,9 @@ launchmon_rc_e linux_launchmon_t::handle_trap_after_exec_event(
17811788#endif
17821789
17831790 {
1784- self_trace_t::trace (true , // print always
1785- MODULENAME, 0 ,
1786- " The RM process has just been forked and exec'ed." );
1791+ self_trace_t::trace (LEVELCHK (level2),
1792+ MODULENAME, 0 , " The RM process (%d) has "
1793+ " just been forked and exec'ed." , p. get_pid ( true ) );
17871794 }
17881795
17891796 bool use_cxt = true ;
@@ -1830,7 +1837,7 @@ launchmon_rc_e linux_launchmon_t::handle_trap_after_exec_event(
18301837//
18311838// Corner case; we deal with a heuristics
18321839//
1833- #if PPC_ARCHITECTURE
1840+ #if PPC_ARCHITECTURE || POWERLE_ARCHITECTURE
18341841 //
18351842 // DHA Mar 05 2009
18361843 // There're systems that do not directly
@@ -1858,7 +1865,7 @@ launchmon_rc_e linux_launchmon_t::handle_trap_after_exec_event(
18581865#else
18591866 = p.get_gprset (use_cxt)->get_pc () & 0xffff0000 ;
18601867#endif
1861- #else /* PPC_ARCHITECTURE */
1868+ #else /* PPC_ARCHITECTURE || POWERLE_ARCHITECTURE */
18621869 //
18631870 // This requires the actual page size to compute this loader load
18641871 // address implictly. Just using the following bits for now.
@@ -1915,13 +1922,13 @@ launchmon_rc_e linux_launchmon_t::handle_trap_after_exec_event(
19151922 countHandler++;
19161923 // accum and countHandler now contain the cost of this handler which
19171924 // is invoked just once per job
1918- #endif
1919-
19201925 {
19211926 self_trace_t::trace (
19221927 true , // print always
19231928 MODULENAME, 0 , " Just continued the RM process out of the first trap" );
19241929 }
1930+ #endif
1931+
19251932
19261933 set_last_seen (gettimeofdayD ());
19271934 return LAUNCHMON_OK;
@@ -2652,12 +2659,19 @@ launchmon_rc_e linux_launchmon_t::handle_thrcreate_request(
26522659 memset (&tinfo, ' \0 ' , sizeof (tinfo));
26532660 tinfo.ti_lid = (lwpid_t )newlwpid;
26542661
2662+ {
2663+ self_trace_t::trace (LEVELCHK (level2), MODULENAME,0 ,
2664+ " thread creation request event handler "
2665+ " invoked for thread (%d)" , newlwpid);
2666+ }
2667+
2668+
26552669 if (p.get_thrlist ().find (tinfo.ti_lid ) == p.get_thrlist ().end ()) {
26562670// this thread has not been seen
26572671#if X86_ARCHITECTURE || X86_64_ARCHITECTURE
26582672 thread_base_t <SDBG_LINUX_DFLT_INSTANTIATION> *thrinfo =
26592673 new linux_x86_thread_t ();
2660- #elif PPC_ARCHITECTURE
2674+ #elif PPC_ARCHITECTURE || POWERLE_ARCHITECTURE
26612675 thread_base_t <SDBG_LINUX_DFLT_INSTANTIATION> *thrinfo =
26622676 new linux_ppc_thread_t ();
26632677#elif AARCH64_ARCHITECTURE
0 commit comments