public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] tcore.exp
@ 2010-03-19  1:16 Anthony Ton
  2010-03-19  4:47 ` Rishikesh K Rajak
  2010-03-22  6:41 ` Rishikesh K Rajak
  0 siblings, 2 replies; 4+ messages in thread
From: Anthony Ton @ 2010-03-19  1:16 UTC (permalink / raw)
  To: ltp-list@lists.sourceforge.net


[-- Attachment #1.1: Type: text/plain, Size: 1178 bytes --]

Hi Ltp team,

Hi LTP team,

It appears that the proc check_fpu in tcore.exp has an error when the expect can't find the expected string "xmm$num ...".  In the timeout block, the code read

fail "fail to check the xmm value(timeout)"

In my humble opinion, it should be

send_user "fail to check the xmm value(timeout)"

The script crashes with error message:

(gdb) invalid command name "fail"
    while executing
"fail "fail to check the xmm value(timeout)""
    invoked from within
"expect -nobrace -re {xmm5[      ]+{f = .*}+[    ]+{f = .*}} {
                        set buf $expect_out(0,string)
                } timeout {
                    fail "fail to check the xmm value(..."
    invoked from within
"expect {
                -re "xmm$num\[\t \]+\{f \= .*\}+\[\t \]+\{f \= .*\}" {
                        set buf $expect_out(0,string)
                }
                timeout {
                    fail "fail to check t..."
    (procedure "check_fpu" line 7)
    invoked from within
"check_fpu 5"
    (file "/opt/anthony/ltp/testcases/bin//tcore.exp" line 137)

Please let me know how to fix this error.

Thanks,
Anthony




[-- Attachment #1.2: Type: text/html, Size: 3148 bytes --]

[-- Attachment #2: Type: text/plain, Size: 345 bytes --]

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] tcore.exp
  2010-03-19  1:16 [LTP] tcore.exp Anthony Ton
@ 2010-03-19  4:47 ` Rishikesh K Rajak
  2010-03-22  6:41 ` Rishikesh K Rajak
  1 sibling, 0 replies; 4+ messages in thread
From: Rishikesh K Rajak @ 2010-03-19  4:47 UTC (permalink / raw)
  To: Anthony Ton, Min Guo; +Cc: ltp-list@lists.sourceforge.net


Adding the original developer in cc to know opinion about this changes.

-Rishi
On Thu, Mar 18, 2010 at 09:16:50PM -0400, Anthony Ton wrote:
>Hi Ltp team, 
>Hi LTP tea,
> 
>It appears that the proc check_fpu in tcore.exp has an error when the expect
>can't find the expected string "xmm$num …".  In the timeout block, the code read
> 
>fail "fail to check the xmm value(timeout)"
> 
>In my humble opinion, it should be
> 
>send_user "fail to check the xmm value(timeout)"
> 
>The script crashes with error message:
> 
>(gdb) invalid command name "fail"
>    while executing
>"fail "fail to check the xmm value(timeout)""
>    invoked from within
>"expect -nobrace -re {xmm5[      ]+{f = .*}+[    ]+{f = .*}} {
>                        set buf $expect_out(0,string)
>                } timeout {
>                    fail "fail to check the xmm value(..."
>    invoked from within
>>"expect {
>                -re "xmm$num\[\t \]+\{f \= .*\}+\[\t \]+\{f \= .*\}" {
>                        set buf $expect_out(0,string)
>                }
>                timeout {
>                    fail "fail to check t..."
>    (procedure "check_fpu" line 7)
>    invoked from within
>"check_fpu 5"
>    (file "/opt/anthony/ltp/testcases/bin//tcore.exp" line 137)
> 
>Please let me know how to fix this error.
>> 
>Thanks,
>Anthony 

> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev

> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


-- 
Thanks & Regards
Rishi
LTP Maintainer
IBM, LTC, Bangalore
Please join IRC #ltp @ irc.freenode.net

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] tcore.exp
  2010-03-19  1:16 [LTP] tcore.exp Anthony Ton
  2010-03-19  4:47 ` Rishikesh K Rajak
@ 2010-03-22  6:41 ` Rishikesh K Rajak
  2010-03-22 21:06   ` Anthony Ton
  1 sibling, 1 reply; 4+ messages in thread
From: Rishikesh K Rajak @ 2010-03-22  6:41 UTC (permalink / raw)
  To: Anthony Ton; +Cc: ltp-list@lists.sourceforge.net

>It appears that the proc check_fpu in tcore.exp has an error when the expect
>can't \
>find the expected string "xmm$num ...".  In the timeout block, the code read
>
>fail "fail to check the xmm value(timeout)"
>
>In my humble opinion, it should be
>
>send_user "fail to check the xmm value(timeout)"

Hi Anthony,

Send us a patch with the correct changes and then someone can review here.

-- 
Thanks & Regards
Rishi
LTP Maintainer
IBM, LTC, Bangalore
Please join IRC #ltp @ irc.freenode.net

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] tcore.exp
  2010-03-22  6:41 ` Rishikesh K Rajak
@ 2010-03-22 21:06   ` Anthony Ton
  0 siblings, 0 replies; 4+ messages in thread
From: Anthony Ton @ 2010-03-22 21:06 UTC (permalink / raw)
  To: Rishikesh K Rajak; +Cc: ltp-list@lists.sourceforge.net

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

Hi Rishikesh,
See the attached file.
Regards,
Anthony

-----Original Message-----
From: Rishikesh K Rajak [mailto:risrajak@linux.vnet.ibm.com] 
Sent: Sunday, March 21, 2010 11:42 PM
To: Anthony Ton
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] tcore.exp

>It appears that the proc check_fpu in tcore.exp has an error when the 
>expect can't \ find the expected string "xmm$num ...".  In the timeout 
>block, the code read
>
>fail "fail to check the xmm value(timeout)"
>
>In my humble opinion, it should be
>
>send_user "fail to check the xmm value(timeout)"

Hi Anthony,

Send us a patch with the correct changes and then someone can review here.

--
Thanks & Regards
Rishi
LTP Maintainer
IBM, LTC, Bangalore
Please join IRC #ltp @ irc.freenode.net

[-- Attachment #2: tcore.exp --]
[-- Type: application/octet-stream, Size: 3847 bytes --]

#!/usr/bin/expect --

#    Copyright (c) Guo Min <min.guo@intel.com>., 2002
#
#    This program is free software;  you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY;  without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
#    the GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program;  if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

set curr_thread 0 
set pass 0
proc check_buf {buf key} {
    set num 0
    for {} 1 {} {
	set split_buf [split $buf ""]
	set i [string first "\n" $buf]
	if $i==-1 break;
   	set line [join [lrange $split_buf 0 $i] ""]
  	set buf [join [lrange $split_buf [expr 1+$i] end] ""]
	set i [lsearch $line $key]
	if -1!=$i {
		incr num
	}
    }
	return $num
}
proc check_threads {} {
    global curr_thread
    global pass
    set istrue 0 
    send "info threads\n"
    expect {
       	-re " \[0-9\]+ process .*(gdb)" {
	set buf $expect_out(0,string)
    	}
	timeout {
		fail "timeout while  run info threads"
		return 1
	}
    }
    set curr_thread [check_buf $buf "process"]
    if { $curr_thread == 0 } {
	send_user "check_threads (no current thread)\n"
	return 1
    }
    if { $curr_thread >= 1 } {
	set pass [expr $pass + 1]
	send_user "the core dump includes multi thread information\n"
	return 0
    }
}

proc check_bt {} {
	global curr_thread
	global pass
	set test 0
        set counter 1
        while { $counter <= $curr_thread }  {
                send "\n"
                send "thread $counter\n"
                expect {
                        -re "Switching to thread $counter .*\n" {
                                set buf $expect_out(0,string)
                        }
                        timeout {
                                 send_user "timeout ";
                                 return 1
                        }
                }
                set number1 [check_buf $buf "(process"]
                send "bt\n"
                expect {
                        -re  " bt.*#\[0-9\]+ .*(gdb)" {
                                set buf $expect_out(0,string)
		             }
                }
                set number [check_buf $buf "in"]
                if {  $number < 1  } {
			set test 1
	        } 
                set counter [expr $counter + 1]
        }
	if { 0 == $test } {
		set pass [expr $pass + 1]
		send_user "check bt in coredump successfully"
		return 0
	} else {
		send_user  "check bt in coredump incorrectly"
		return 1
	}
        return 0
}

proc check_fpu {num} {
	global expect_out
	global pass
	send "\n"
	send "info register\n"
	send "\n"
	expect { 
		-re "xmm$num\[\t \]+\{f \= .*\}+\[\t \]+\{f \= .*\}" {
			set buf $expect_out(0,string)
		}
		timeout {
	            send_user "fail to check the xmm value(timeout)"
        	    return 1
        	}
	}
	send "quit\n"
	set buf_tmp [split $buf "\{"]
	set buf1 [lindex $buf_tmp 4]
	set buf2 [split $buf1 ","]
	set number [lindex $buf2 1]
	if { 0 != $number } {
		set pass [expr $pass + 1]
		send_user "success while check whether core dump includes fpu information"	
		return 0
	} else {
		send_user "fail while check whether core dump includes fpu information"
		return 1
	}
}
set GDB gdb
set binfile ./tcore
set corefile  ./corefile

spawn $GDB ${binfile} ${corefile}
check_fpu 5
send "quit\n"

spawn $GDB ${binfile} ${corefile}
check_threads
send "quit\n"


spawn $GDB ${binfile} ${corefile}
check_bt
send "quit\n"
exit $pass


[-- Attachment #3: Type: text/plain, Size: 345 bytes --]

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2010-03-22 21:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19  1:16 [LTP] tcore.exp Anthony Ton
2010-03-19  4:47 ` Rishikesh K Rajak
2010-03-22  6:41 ` Rishikesh K Rajak
2010-03-22 21:06   ` Anthony Ton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox