2

I'm getting below error with systrace tool provided by android Jelly bean SDK on windows 2003 PC with python 2.7

executing below command in cygwin editor

python systrace.py --time=10 -o mynewtrace.html

▒GS{▒&▒izAr ▒▒9▒Zww▒▒▒Hj▒▒K▒[X▒▒▒4▒i▒▒D▒▒@▒"▒▒▒]▒lJ▒!▒▒)K▒dKY▒▒:\▒?▒ ▒?w%{D▒g▒?Q&▒wQ▒▒p%'T▒▒oE▒(▒:▒▒k▒▒◄▒▒)▒2▒?▒%▒▒4▒w^▒ ▒~▒▒/▒g▒7?M?▒c▒r#/▒oDE▒tg▒▒N▒▒S'\▒▒▒▒↓▒▒GY▒x▒↓▒2D'↓CN▒{▒f2?pu▒▒?▒▒▒▒(g▒▒9▒f▒<A▒Hz▒+P/▒▒sTU▒b▒?{▒/▒▒▒▒4u_▒▒?▒!0▒▒▒▒1▒▒▒▒@1 ▒▒▒s ▒↓
    Y▒;♥♥▒▒3G▒H     ▒▒&v▒▒:♦▒{▒▒*▒?7▒▒=▒"▒♥▒▒▒▒▒♥▒▒▒<▒:n?♥<i▒▒►    ▒v/▒▒↓▒/♣c▒.▒)#Ou/▒▒O▒▒?▒▒▒%▒A,4+▒x▒▒▒@▒*gfσ▒7▒♣▒▒EtV▒3▒▒▒▒▒r♦▒kQ▒a♦↓▒▒|/:Iy▒{▒◄x8y▒▒▒h▒M▒▒▒G|▒▒"#⌂▒▒gK-▒▒▒'▒▒(▒▒FfN▒▒▒▒▒↑▒▒~4▒⌂▒T?r▒▒▒▒▒▒!▒?▒?▒▒▒▒~CaO▒
ho▒▒L▒H▒9▒▒▒Lh▒▒▒iY▒$4▒d▒▒.C▒▒►@!↓↑▒▒▒▒RQ▒;c▒▒▒?@3▒g▒▒▒▒?G▒y▒▒?Fb▒B=▒▒W|▒%Zc▒▒Q▒UY?♣▒c▒▒$v▒▒▒?▒8▒4v▒h▒▒▒I↑▒`▒Kb▒,▒▒Y▒▒#▒+▒▒▒▒=▒▒▒▒▒▒▒▒

e▒*▒e⌂▒▒"▒P▒!↑▒}▒n♦▒IW      ▒▒▒
▒⌂▒)♠K▒?ln▒D♠:z▒:♥▒xA>▒▒LGX↑▒O▒▒W9Z▒▒p▒8▒xG$?▒▒;▒,▒M▒▒▒▒`▒kH▒▒▒kd9▒4t6▒xQH%o▒▒▒▒▒▒O▒▒▒@▒▒▒x▒3▒▒0◄~▒♦▒▒*#W▒▒▒_▒▒_y▒▒▒04▒▒▒▒P-R2K▒▒▒(?B▒e9▒g▒8M37A4▒▒n▒▒@▒▒m▒I▒.▒=▒3▒c▒▒?▒▒s▒▒▒j▒4e▒▒*E▒Q1N▒▒▒▒▒▒▒qy▒▒▒▒▒▒▒▒▒▒▒▒aN?▒_▒▒▒▒▒28_~▒]e♦▒▒▒▒&g♥v3►p▒p▒`▒J▒/▒X⌂▒{▒▒▒-▒▒▒rI▒%Q▒⌂▒▒q▒▒▒▒?▒▒▒▒/hE▒▒▒?▒▒▒▒▒▒▒7▒6▒W▒j▒▒▒w▒▒O▒▒>▒▒▒▒?▒xy▒▒v▒▒▒⌂?4▒T▒a▒◄▒c▒▒▒O7▒⌂v⌂|▒▒rL▒*▒♠▒▒▒#▒▒▒▒~}▒▒

▒K▒H2▒▒▒^l▒RI▒c^$9S$▒=▒▒BI:▒6cj+▒▒▒@
>▒▒▒&f      ▒▒▒$▒▒◄▒?▒r▒C▒Ze♥↓▒%▒▒&▒@6▒CE▒▒◄+G♣-▒▒]▒ ▒▒[c▒b\▒MBhu▒O▒▒2▒!+y▒▒▒▒lDt▒U▒▒e▒I5▒\▒▒=▒▒▒▒▒▒T▒T▒▒▒♦^▒▒v▒k▒?▒-▒▒*▒)▒9▒t?▒▒cq▒,$▒▒▒

▒▒+▒▒OM▒@▒▒▒=?▒,?d;k▒♥p▒▒sd▒w▒▒▒▒▒I▒▒p▒nk▒▒D▒▒J▒Gh▒AJ▒B
▒t▒?%D▒q▒yUfyb▒?▒▒▒o▒/q*▒▒▒%i▒▒▒▒▒?>▒v▒/▒>_-▒▒~▒▒▒▒cu▒▒▒▒▒/▒▒|▒~▒▒v3▒▒▒_▒v▒~y"▒▒?▒▒▒▒▒▒_?▒▒▒/Oj▒>▒▒▒▒~▒\▒▒▒▒▒▒▒#▒▒t▒▒2Z▒K▒8_▒▒▒J▒*▒▒▒▒^a▒▒▒4W-▒▒▒TAn error occured while capturing the trace.  Output file was not written.

Any environment variable should be added for python?? if yes which variable has to be added? Can anyone help me in resolving this issue?

Thanks & regards

mccannf
  • 16,619
  • 3
  • 51
  • 63
  • I get the same garbage as well. I thought it might be the terminal encoding or something along those lines. So, I tried UTF-8, and ISO-8859-16:2001 (Latin-10, Balkan). No difference. Please update this issue if you find a solution. Cheers – Keo Malope Dec 18 '12 at 22:25
  • Possibly related question: http://stackoverflow.com/questions/11038725/encoding-issues-using-adb-to-dispatch-messages – Keo Malope Dec 18 '12 at 23:13

1 Answers1

1

The reason it's not working on Cygwin is because the stream coming from the device actually has two carriage returns before every line feed. You can see this by putting in a call to 'print repr(out) after reading from adb.stdout.

You just need to update systrace.py as follows to work around this:

if sys.platform == 'cygwin':
  out = out.replace('\r\r\n', '\n')
else:
  out = out.replace('\r\n', '\n')

I posted a patch at https://android-review.googlesource.com/55170 to fix this.

John Michelau
  • 1,001
  • 8
  • 12