Run the following command in Terminal to see exactly how many of OS X's extensions are 64-bit and how many are still 32-bit:
|
|
Run the following command in Terminal to see exactly how many of OS X's extensions are 64-bit and how many are still 32-bit:
file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i x86_64 |nl |tail -1 |cut -f1 -f3 && file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -v x86_64 |nl |tail -1 |cut -f1 -f3
[robg adds: This command will take a few seconds to run. On my MacBook Pro, there are 129 64-bit extensions and 325 32-bit extensions.]
•
[9,665 views]
Hint Options
10.6: How much of Snow Leopard isn't yet 64-bit?
The following will run faster, it shows ppc kexts as well:
10.6: How much of Snow Leopard isn't yet 64-bit?
The counts don't match the command in the hint.
127 Mach-O 64-bit kext bundle x86_64
137 for architecture i386 ---
10.6: How much of Snow Leopard isn't yet 64-bit?
I concur. This one-liner seems to be the best (correct, short and most efficient) submitted so far.
10.6: How much of Snow Leopard isn't yet 64-bit?
I've spotted one small problem with this: you get only the various architecture counts and not the count of all extensions. Thus you can tell how many extensions have a 64-bit binary, but not how many extensions do not have (which was the point of the original post).
Here's a one-liner that should provide all the info:
file /System/Library/Extensions/*.kext/Contents/MacOS/* | awk 'BEGIN {total=0} /^[^(]*$/ {total++} /([^)]*)/ { start=index($0, "(")+1; $0=substr($0, start, index($0, ")")-start); kexts[$NF]++ } END { print "kexts total: " total; for (kext in kexts) print kext ": " kexts[kext] } '
It provides an output (on a 10.5.x) like this: kexts total: 220The number of extensions without 64 bit arch is: "kexts total" - "x86_64" (and of course the latter is zero in my case since I'm still running 10.5).
10.6: How much of Snow Leopard isn't yet 64-bit?
Unfortunately the previous one was still buggy. :-(
For non-universal binaries the file command outputs only a single line like this:/System/Library/Extensions/AppleEFIRuntime.kext/Contents/MacOS/AppleEFIRuntime: Mach-O object i386However, in case of a universal binary the "(for architecture ...)" section contains the real thing, since the "Mach-O object ..." section contains only the main architecture class. Eg. /System/Library/Extensions/TMSafetyNet.kext/Contents/MacOS/TMSafetyNet: Mach-O universal binary with 2 architecturesTaking this into account, here's a (hopefully now) correct one-liner:
file /System/Library/Extensions/*.kext/Contents/MacOS/* | awk '/Mach-O +[^ ]+ +[^ ]+$/ {if (match($0, "\\(for +architecture +")) { arch=substr($0, RSTART + RLENGTH); arch=substr(arch, 1, index(arch, ")")-1) } else { arch=$NF }; archs[arch]++; sub("( \\(for +architecture +[^ )]+\\))?:[^:]+Mach-O +[^ ]+ +[^ ]+$", ""); binaries[$0]=1 } END { total=0; for (bin in binaries) total++; print "total: " total; for (arch in archs) print arch ": " archs[arch] } '
It produces an output like this (on 10.5): total: 220And you can run it on /Applications/*.app/Contents/MacOS/* too and get a result like this: total: 127For the latter I should mention that I've already cleaned up /Applications with Xslimmer and Monolingual.
10.6: How much of Snow Leopard isn't yet 64-bit?
Just a quick comparison between 10.5.8 and 10.6.0:
Running the line mentioned in the previous comment on 10.5.8:
109 for architecture i386
For 10.6.0: 135 for architecture i386 Interesting.
10.6: How much of Snow Leopard isn't yet 64-bit?
You can also look at "Extensions" in the "Software" section of the System Profiler utility. (Select Apple Menu->About This Mac and then click "More Info"). One of the columns shows whether the .kext is 64-bit capable. Only those extensions that are not 64-bit will show up with a "No" in that column.
10.6: How much of Snow Leopard isn't yet 64-bit?
Very good post. I see 8 non-64-bit libraries with the System Profiler, and that's 3 CHUD (developer/debig) and 5 libraries with 6.0 in their names that also exist without the 6.0, so I think they are all compatibility:
10.6: How much of Snow Leopard isn't yet 64-bit?
Wow...this is entirely wrong. It counts each architecture in a universal binary as a different entry.
If you really want to know how many of your kext's are able to run x86_64, how many will only do i386 and how many are only ppc, try this:
Which in more readable form is:
And the total of those three lines of output should equal:
-dbingham
10.6: How much of Snow Leopard isn't yet 64-bit?
You have to remember that some kexts never need to be 64-bit.
Hardware specific to Core Duo Intel machines for example, do not need 64-bit extensions because Core Duo chips are only 32-bit.
10.6: How much of Snow Leopard isn't yet 64-bit?
141 for architecture i386 |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.12 seconds |
|