Archive for February, 2009

Another Seagate Bites The Dust

Posted by Dallas on February 19, 2009
Personal / No Comments

If you follow any Tech news, chances are you have heard of the epic fail that Seagate has been having with their Barracuda drives.

However, if you have been under a rock, Seagate had an issue in some of their drive’s firmware, where after a certain point in time the drives would just stop responding after a shutdown/reboot.

If you are like me you thought, “wow, that sucks” and moved on since you either don’t have a Seagate (or don’t know you do) and/or because your drive is working.

Well all that was until last night….

I had not paid much attention to the Seagate news, as I forgot that 2 of my drives were Seagate.
This lead me to not reading the entire articles, and therefore I missed that you could be affected by this issue and not know it until you reboot.
This fail of Seagate fell further in my head as I hadn’t needed to reboot my Mac in about a month.

Finally last night I rebooted and CRAP one of my 1 TB drives is missing!
Ok… Lets try rebooting again… Still nothing!

I posted my frustration on Twitter and was hit back with a ton a reply’s asking if it was a Seagate drive. I wasn’t sure, so I pulled the Mac Pro out from under my desk and to my surprise 2 of my TB drives are Seagate. (Yet only 1 stopped working)
So I started searching around and found the Seagate page about the issue where it asked for a serial number to see if I was affected.
CRAP I didn’t write it down.
Time to pull out the computer again!
Ok, now back to the Seagate page, and YES my drive is affected by this issue.

OK, great, now FIX IT!

Oh no no no…

First all the info they give about fixing the issue talks about Windows.
Nothing for Mac.
Then I find a Mac site talking about how to fix the issue, once you have the firmware from Seagate.
Yet on Seagate’s site it just says to contact the OEM.
It won’t give me the stupid firmware and of course their Tech support is not open.

Finally this morning on got on with a Tech support person at Seagate and the gave me this url for the firmware.
http://seagate.custkb.com/seagate/crm/selfservice/search.jsp?DocId=207963&Hilite=es.2

Now I have to wait until I get home to try it out.

If there is ANY chance you have a Seagate hard drive I HIGHLY recommend you check to see if your affected BEFORE you are affected!

Check this page for more info on how to find out
http://seagate.custkb.com/seagate/crm/selfservice/search.jsp?DocId=207931

Log all accessed methods in Objective-C with DTrace

Posted by Dallas on February 07, 2009
Cocoa, Cocoa Touch, DTrace, Mac, Objective-C, Programming, iPhone / No Comments

I have recently been debugging some Objective-C and Cocoa/Cocoa Touch code.

Not being familiar with all the code and with a TON of methods being accessed in milliseconds, my attempts at stepping through the code just wasn’t working, as clicking ‘Step Into’ as fast as I could keep up and over an hour of stepping through I was still not even close to figuring out what I needed to know.

This lead me to the thought of logging every method that was accessed and then I could step look through it and skip around as needed.
However with 60 some odd files and say maybe 20 methods in each file, that would take a lot of NSLog’s.
I started looking around and was pointed to bbums blog about doing something similar.
However it still would take adding some code, plus I couldn’t get it working right with the iPhone.

This lead me to wonder about DTrace.
After a recent podcast from Scotty at the Mac Developer Network, featuring Colin Wheeler talking about DTrace, I have been very interested in learning more about DTrace.

The difficult thing I have been finding is that since DTrace was originally written for Sun, it is hard to find info related to MacOS and more so Cocoa.

I then found a video from Colin about using DTrace with Cocoa and XCode.
http://www.viddler.com/explore/Machx/videos/8

I wasn’t able to get what I wanted working, so I hit Colin up on Twitter and then talked to him a bit in email and he pointed me to the Golden Solution!

The solution is:
objc$target:::entry{}

So I took that and created a DTrace script.
You can grab it here:
http://kdbdallas.com/wp-content/uploads/2009/02/logallmethodsd.zip

To run it open Terminal and run:
sudo ./logAllMethods.d -p PID

Of course replacing ‘PID’ with the PID of your running program and remembering that for DTrace ’sudo’ is required.

Also note that this works for iPhone programs running in the iPhone Simulator.
Just look for the PID of your iPhone app within Activity Monitor once it’s running in the simulator.

Be careful as depending on the program it can spit out a TON of data VERY quickly.

Running this against Adium for only a fraction of a second gave me a couple hundred lines of output.

The output looks like this:

tesseract:Desktop dallas$ sudo ./logAllMethods.d -p 4371
dtrace: script ‘./logAllMethods.d’ matched 71222 probes
CPU ID FUNCTION:NAME
0 59398 -retain:entry
0 34684 +retain:entry
0 32061 +idleAllMovies::entry
0 32062 -idle:entry
0 34707 -retain:entry
0 32914 -_usingVisualContext:entry
0 32878 -_resyncNaturalSize:entry
0 31935 -loadState:entry
0 31972 -naturalSize:entry

Hopefully this helps someone out there.
Just remember always use the info I post for good.
(or if its for evil make sure it profitable and then send me a cut)

Once again, special thanks to Colin Wheeler.

Tags: , , , , ,