scaling current frequency not displaying appropriate result
<p>I am using cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq to extract the current frequency. But whenever I run this command, I get the maximum frequency being set, while when I pull from DDMS, the file shows different frequency. Can you suggest what could be the error?</p>

<p>My Code:</p>

<pre><code>public String getCurrentCPU()
    {
        Process process;
        try{
        Runtime rt = Runtime.getRuntime();
        process=rt.exec("cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq");
        BufferedReader reader = new BufferedReader(
                new InputStreamReader(process.getInputStream()));
        int read;
        char[] buffer = new char[4096];
        StringBuffer output = new StringBuffer();
        while ((read = reader.read(buffer)) &gt; 0) {
            output.append(buffer, 0, read);
        }        
        reader.close();
        process.destroy();
        //process.waitFor();
        return output.toString();
        }       catch (IOException e) {
            throw new RuntimeException(e);
        } 
    }
</code></pre>
