Re: profiling the resume path

2007-09-06 Thread Marcelo Tosatti
Hi Thomas,

I found something that looks strange behaviour while profiling the
resume-from-RAM path on OLPC.

A little explanation on traces: they have been gathered using Arnaldo's
refactoring of latencytrace patches 

From 3e81bb2749ab132f7ff68a22880754e206d7986a Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
Date: Wed, 25 Jul 2007 15:12:22 -0300
Subject: [PATCH 1/9] [MCOUNT]: Add basic support for gcc profiler
instrumentation

If CONFIG_MCOUNT is selected and /proc/sys/kernel/mcount_enabled is set to a
non-zero value the mcount routine will be called everytime we enter a kernel
function that is not marked with the notrace attribute.

Then it records that into a ring buffer.

so, 

This no need resched! printk was added inside the 

while (!need_resched()) {
void (*idle)(void);
...
}

loop of cpu_idle().

And I gathered two different traces of the exact same kernel.

Trace #1:

[0.059910] ohci_hcd :00:0f.4: powerup ports
[0.060119] no need resched!
[0.070230] no need resched!
[0.097732] no need resched!
[0.106032] tick_nohz_stop_sched_tick: next_jiffies = 4294947976, 
last_jiffies = 4294947974 jiffies = 4294947974
[0.106174] tick_nohz_stop_sched_tick: expires=[106,8]
[0.106270] tick_nohz_stop_sched_tick: now=[106,786802612]
[0.106369] no need resched!
[0.119478] tick_nohz_stop_sched_tick: next_jiffies = 4294947978, 
last_jiffies = 4294947976 jiffies = 4294947976
[0.119618] tick_nohz_stop_sched_tick: expires=[106,82000]
[0.119714] tick_nohz_stop_sched_tick: now=[106,800253059]
[0.119813] no need resched!

Then the resume path restarts at (this is from mctrace, I added another
msleep right after msleep(20) for diagnosis).

[0.119336] ohci_pci_resume+0x8c/0xa0 - msleep+0xb/0x27

Trace #2:

Another run with the same kernel.

[0.059903] ohci_hcd :00:0f.4: powerup ports
[0.060108] no need resched!
[0.070225] no need resched!
[0.097726] no need resched!
[0.125226] no need resched!
[0.152728] no need resched!
[0.180230] no need resched!
[0.206887] tick_nohz_stop_sched_tick: next_jiffies = 4294942086,
last_jiffies = 4294942084 jiffies = 4294942084
[0.207028] tick_nohz_stop_sched_tick: expires=[47,9]
[0.207123] tick_nohz_stop_sched_tick: now=[47,886800917]

Which restarts at

[0.220191] ohci_pci_resume+0x8c/0xa0 - msleep+0xb/0x27

Sorry, but how the hell that can happen? 

Both runs look totally hosed since the msleep(20) call from
ohci_pci_resume happens at 59ms, and we have an interrupt at 97ms (on
both traces) which should get the system out of the idle loop.

Full traces:
http://dev.laptop.org/~marcelo/mctrace/trace1.txt
http://dev.laptop.org/~marcelo/mctrace/trace2.txt

Whoever sets TIF_NEED_RESCHED is not doing its job properly?
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Scheduled server maintenance: 9/7

2007-09-06 Thread Ivan Krstić
Public-facing development services (bugtracker, git, development  
hosting) will be partially offline tomorrow, Friday the 7th, for a  
migration to different hardware, concluding the emergency maintenance  
from earlier this week. Downtime is expected to start around 9PM EDT,  
and has an expected duration of under 12 hours.

This round of maintenance is also when I shall (unceremoniously) pass  
my unofficial sysadmin baton to Danny Clark, OLPC's new -- and  
official -- sysadmin. Further sysadmin/downtime announcements will be  
coming from him; please make him feel at home by breaking our  
machines early and often, preferably in the wee hours of the morn.

Cheers,

--
Ivan Krstić [EMAIL PROTECTED] | http://radian.org

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


RE: How does record activity the camera in Sugar?

2007-09-06 Thread Gary.Chiang
Dear: Erik,

 

It looks like LX GPU overlay function have some problem

 

But I am not sure,

 

We use failed OX unit to record a video file , then playback 

 

It is still can see the noise and straight lines on left side .

 

if we use another OX to play the same video file, it looks no problem at all.

 

 

Best Regards,



Gary Chiang 江品逸

Tel : 886-3-3272345ext:18332

Cell: 0972633651

[EMAIL PROTECTED]





From: Erik Blankinship [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 06, 2007 8:28 PM
To: Luna Huang (�S��玲)
Cc: devel@lists.laptop.org; Gary Chiang (江品逸)
Subject: Re: How does record activity the camera in Sugar?

 

I am glad to hear that those tests were passed satisfactorily.

It would seem that the camera is working correctly.

More questions:

*   Do the camera problems happen before or after suspend/resume?  There 
have been some visual artifacts with the camera after suspend/resume. I suspect 
this might be the problem. 
*   If you take a photo with the Record activity, does the photograph have 
the same problem?
*   Is this a different C test build than the other C test builds?

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: headtracker / mag lens / macro lens ([EMAIL PROTECTED])

2007-09-06 Thread linaccess
On Wed, 05 Sep 2007 12:40:38 -1000
Mitch Bradley [EMAIL PROTECTED] wrote:

 [EMAIL PROTECTED] wrote:
  I tried not to move my eyes but my head and looking to the four corners and 
  the center of the XO display. The display is very small so I moved my head 
  really not to much ...
 
  Maybe I have got a knot in my brain. 

 
 I'm pretty sure that if I had to keep my head still to avoid moving the 
 mouse, I would have a knot in the back of my neck after a short time.  
 Whether the knot would then travel to my brain, I don't know.  :-)
 


lol
after working with the touchpad it feels like having knots in my wrist and 
fingers. It could not be worse :-) 

BTW, the activities and sugar need (more) shortcuts to control the XO without 
the touchpad or mouse. 

yokoy

-- 
 
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Could you teach me how fine the physcial addtess?

2007-09-06 Thread Mitch Bradley
Adding devel@ to the list because this is generally useful information

Jordan Crouse wrote:
 On 06/09/07 14:29 +0100, David Woodhouse wrote:
   
 On Thu, 2007-09-06 at 20:57 +0800, [EMAIL PROTECTED] wrote:
 
 Could you teach me how find the DCOM register in CPU?

 For example, I want to read a DC register, DC_GENERAL_CFG register.

 I know its memory offset is 004h but I don’t know how find the base
 address.

 Study the CPU spec. but not really understand.
   
 I believe the easiest way to find those is through a PCI BAR, although
 actually it's set by magic GeodeLink stuff. Jordan is the best person to
 ask.
 

 The DC lives at 0xfe004000. All the video base addresses are in PCI
 header device 00:01.1, PCI id 1022:2081.

 Bar 0 is the framebuffer,
 bar 1 is the graphics processor
 bar 2 is the display controller
 bar 3 is the video processor

 Jordan

   

Here are some techniques you can use from Open Firmware:

ok screen-ih iselect
ok see dc@
: dc@
   dc-base + rl@
;
ok dc-base map?
VA: ffae8000 PA: fe004000
Mode: 73 Dirty Accessed Don'tCache Supervisor R/W
ok dc-base physical .
fe004000
ok 918 config-l@ .
fe004000

The 918 config-l@ . displays the value of BAR 1.  How did I get the 
918 number?   The general pattern for the PCI config space address of a 
BAR is:

  (bus# * 0x1)  +  (device# * 0x800)  + (function# * 0x100)  + 0x10  
+ (BAR# * 4)

(The 0x10 is the starting offset of the BARs in the device's block of 
configuration registers.)

In this case, bus# =0 (because this is the root PCI bus - there are no 
PCI to PCI bridges in the system - this is the 00 in 00:01.1), device# 
is 1 (the 01 in 00:01.1), function# is 1 (the .1 in 00:01.1), BAR# is 2:

  (0 * 0x1) + (1 * 0x800) + (1 * 0x100) + 0x10 + (2*4) = 0x918

How did Jordan know which BAR is which?  Well, one way is to read the 
source code for either the Linux driver or the OFW driver.  That 
information is not in the LX hardware specification.  The reason it is 
not there is because the graphics hardware is not really on the PCI 
bus!  It is really on an internal bus inside the LX processor.  The 
hardware manual cannot document which BAR is which because there really 
are no BARs in the LX hardware!

Software pretends it is on the PCI bus because OSs have well-developed 
frameworks for handling PCI devices, and do not have frameworks for 
handling the real GeodeLink internal hardware architecture.  How does 
the software do this pretending?

In the case of a conventional BIOS, there is special VSA code that 
runs in system management mode.  The VSA code intercepts accesses to the 
PC I/O port addresses that are used for PCI configuration space access, 
and runs complicated system-management-mode code that emulates PCI 
configuration registers for the devices that are inside the LX CPU and 
the CS5536 I/O chip.

In the Open Firmware case, I didn't want to use VSA because it is hard 
to maintain (for example we don't have a compiler that will compile the 
code) and slow (it would have made startup and resume take longer).  So 
instead of emulating the PCI configuration access by intercepting the 
I/O port accesses, I added a small amount of code to the PCI 
configuration access subroutines in the Linux kernel and OFW.  That code 
does effectively the same thing as VSA, but at a slightly higher level - 
it notices that the configuration space address is for one of the 
internal devices, and returns the right value from a table in memory.

So back to the question of where the BAR numbers are documented:  AMD 
has a document that describes the emulated PCI config registers that the 
VSA provides.  That document is hard to get; it is on AMD's restricted 
web site.  It is easier to get the information either by reading the 
driver code or by asking Jordan.

How does the hardware actually establish the physical address of the 
DC?  Well, the LX CPU has some P2D MSRs that control address 
assignment.  Any P2D MSR can map an address to one of several devices, 
so there is not a fixed assignment of P2Ds to specific devices.  OFW 
chooses to use the P2D MSR at MSR number 0x102a to map the DC.  The 
value in that MSR is 0x801ffcfe.007fe004 .  You can look up the bits in 
that MSR if you want to understand how it really works.  OFW maps the GP 
with  MSR 0x1022, and the VP+VIP with MSR 0x1023.

One more topic:  You can find PCI device and function numbers with:

ok show-devs /pci
/pci/[EMAIL PROTECTED],5
/pci/[EMAIL PROTECTED],4
/pci/[EMAIL PROTECTED],3
/pci/[EMAIL PROTECTED],2
/pci/[EMAIL PROTECTED],1
/pci/[EMAIL PROTECTED]
/pci/pci1022,[EMAIL PROTECTED],2
/pci/[EMAIL PROTECTED]
/pci/[EMAIL PROTECTED],1
/pci/[EMAIL PROTECTED]
/pci/[EMAIL PROTECTED],5/[EMAIL PROTECTED],0
/pci/[EMAIL PROTECTED],1/disk
/pci/[EMAIL PROTECTED]/[EMAIL PROTECTED]
/pci/[EMAIL PROTECTED]/[EMAIL PROTECTED]
/pci/[EMAIL PROTECTED]/[EMAIL PROTECTED]
/pci/[EMAIL PROTECTED]/[EMAIL PROTECTED]
/pci/[EMAIL PROTECTED]/[EMAIL PROTECTED]
/pci/[EMAIL 

Re: Pippy and Calculate - Evolution Solution

2007-09-06 Thread Steve Fullerton
Hi All,

I am a lurker, but this is an interesting discussion.  I am a
developer in health applications working with current dev release on a
B4.  Calculate is impressive; Pippy is impressive.  They each serve a
purpose which I think fits into an OPLC evolutionist philosophy.

First, there are US toys that are remarkably similar to the OLPC in
appearance that comprise a simple 4x4 calculator aimed at the under 5
year old crowd.  Large keys that do arithmetic.

Guido in his wisdom, incorporated and uses in his tutorial the
calculator attributes of python to convey --- not arithmetic --- but
the meaning of interpretive to a neophyte programmer.

I think both activities have a place, and further, should/could be
seamlessly integrated so that a child in the Ivory Coast who learns
arithmetic using Calculate can discover Pippy and say: Zoot alors! Je
peux faire la même chose dans Pippy ! or something like that.  Very
constructionist.  A intellectual bridge to understanding and learning
python prior to being able to comprehend a Fibonacci series (although
we want kids to get there as quickly as possible.)

As a very simple example of seamlessness, I would change the enter key
in the Calculate activity to mimic exactly in size/shape the enter key
on the OLPC keyboard -- e.g. square with check box symbol and maybe do
the same in Pippy in place of the print key that Yoshiki suggests?

I don't think we can escape the fact that the OLPC activity suite will
ultimately have to be configurable at the national, school, teacher,
and pupil levels.  I think there is a reason and purpose for both
Calculate and Pippy.

Some p.s. thoughts --- Many Applications/Activity developers seem to
have a natural inclination to add complexity as the activity evolves
--- witness MS Windows.  In the OLPC I would suggest that we strive to
add simplicity.  Will millions of children who grew up using Sugar
want to transition to MS Windows when they come of age?  I think/hope
not.

/Steve



On 9/5/07, Yoshiki Ohshima [EMAIL PROTECTED] wrote:
   Hi, Chris,

  (I'm the Pippy author.)

   (We didn't have much time to discuss with you while I was in
 Cambridge two weeks ago...)

Imagine if Pippy has a button called Print!, which would be
  located right next to the Run!  button.  And, if Print! prints
  out the results of running the program into the bottom pane, that
  is pretty much all we need.  (For the record, the workspace in
  Etoys has been there from day one for this purpose.)
 
  This is a useful idea, thanks.  At the moment, Pippy doesn't keep any
  variable/program state inbetween Run!s (each run is a new Python
  interpreter), so there is no way to do Ans*2-style calculations.
  It sounds like you want Print! to keep a single interpreter that
  reinterprets the source pane at each click.

   I didn't think about that aspect, but keeping state will be useful.

  The first version of Pippy used a single Python interpreter that
  executed the program source code in this way, without losing state,
  but that makes it possible to write programs that will not run on a
  fresh interpreter later (as they refer to state that was generated
  as a result of code that no longer exists, or a previous run of the
  code), so I decided against keeping that.

   Yeh, that can happen in a typical workspace programming.  But in
 Pippy's setting, it would not be much of a problem.  Keep button can
 store the state altogether into a journal entry.

  Oh!  We could have an example in Pippy that, when run, gives you a
  Python interactive shell.  That should work well; it gives you the
  mode you want (without requiring an extra button), and is useful in
  any case.  I'll do that.
 
  I don't think Python's evaluations are useful as a calculator to
  a child, though.  You would have to explain this:
 
   2+2
  4
   3/4
  0
 
  I would like to add a simple graphics screen to Pippy, but I don't
  intend it to get many more features past that -- I'd like to keep
  it at a simple introduction to input/output programming.

   Yeah, I was aware of the division (/) problem (when I see the last
 digit in Calculate falls off to the next line.  It would be nice if
 you can override the division operator...

  We have a real problem of shortage of man-power, so replacing
  smaller activities that take more time to maintain and document
  with more powerful ones is probably a good thing.
 
  Just a note that Reinier Heeres is a volunteer, so isn't pulling OLPC
  man-power away from any other projects.

   Well, a volunteer can certainly contribute one of OLPC projects,
 right?

   I now see that the timeframe and practical matters will probably
 prevent us going to the nice merging point between these different
 projects.  However, I still contend that similarity is close enough.
 So, for example Pippy doesn't have to be confined this is a Python
 thing mind, but take advantage of similarity.

 -- Yoshiki
 

Re: headtracker / mag lens / macro lens ([EMAIL PROTECTED])

2007-09-06 Thread linaccess
hi,

has anybody experince (and libs) with phase correlation?
I have no idea how to implement it.

Another promising lib is 
http://en.wikipedia.org/wiki/OpenCV

greeting,
yokoy



On Wed, 05 Sep 2007 19:40:29 -0400
Benjamin M. Schwartz [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 I am not at all clear on what you are doing, or why.  However, you may want to
 check out
 
 http://en.wikipedia.org/wiki/Phase_correlation
 
 this is the most accurate possible method for recovering the position of a
 moving object.  If you have a fast FFT available it may be quite efficient.
 

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: headtracker / mag lens / macro lens ([EMAIL PROTECTED])

2007-09-06 Thread linaccess
Hi,

On Thu, 06 Sep 2007 14:55:31 -0400
Benjamin M. Schwartz [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Have you ever used a IBM/Lenovo Thinkpad laptop with the red joystick-mouse in
 the middle of the keyboard?  These use the position of the joystick to control
 the velocity of the cursor.  I am using one right now, and I find it quite
 effective.  The joystick only is able to record a few positions, but because 
 it
 is used to set velocity, the effect is very high precision.
 
 This might allow very small motions to be used, improving comfort.
 

yes, I am sitting at an ibm x20 right now and I like that build in stick from 
IBM much more than touchpads. On the other hand I used such a stick on a 
toshiba, too. It was horrible...

 - --Ben
 
 
 P.S. I have now realized that phase correlation is probably unnecessary for 
 you,
 because your image already contains a single bright spot.  Phase correlation
 would be appropriate if you wish to attempt this without the reflector, based 
 on
 the face itself.

OK. I still want to realize as much as possible hardware based (well, depends 
on price). The XO is a slow machine so some time ago I concluded to wipe out 
unneeded information using IR LEDs and IR Filter. With that the activities 
should stay usable without slowed down a lot. The board, IR LEDS, reflectiv 
foil, IR Filter and the resistor costs less than 1,5 Euro. Buying them as an 
end customer. Put those parts onto the XO board by default would cost only a 
few cents.

Maybe the next generation of XO have intergrated them? A small slot in front of 
the webcam lense could pick up various filters and lenses. Also suitable for 
microscope projects.

yokoy
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel