Get XNNPACK Profiling Info in TfLite Example
Hi @FabianSchuetze 

As per the [documentation](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/examples/label_image), to use XNNPACK delegate we have to set flag `-x 1`. Have you tried this flag along with profiling and see if XNNPACK profiling information is visible?

Thanks. Thanks, @pjpratik  for your reply. 

Yes, I have and I still get the same result. 

Interestingly, I can get very good profiling information for xnnpack for the benchmarking app.  Hi @FabianSchuetze, It does not seem that the flag is getting passed down to the delegate, but you're saying that you are getting good profiling information on the benchmarking app? (I'm assuming you meant benchmark_model??) can you give me the exact commands you are using there so that I can see how it passes down the flag in that instance. Thanks for your help. I have a fix for this. I will update once the fix is merged. Thanks a lot, @pkgoogle  and please apologize for the delayed response.  Hi @FabianSchuetze, the fix is comitted: 535fd94, can you rerun your test on master or nightly and let us know if your issue is resolved? Thanks. Thanks for working on this, @pkgoogle . 

It almost resolved the issue. There is no entry for 
```
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
```
Which is great.

However, there is still no profiling active. 

With the build command in the [docs](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/examples/label_image/README.md), the `NoopProfiler` is enabled in the [example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/examples/label_image/label_image.cc#L266). 
```
  auto profiler = std::make_unique<profiling::Profiler>(
      settings->max_profiling_buffer_entries);
  interpreter->SetProfiler(profiler.get());
```
To get informative profiling output, I had to circumvent the `ifdefs` in [profiler.h](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/profiling/profiler.h)
```
// TODO(b/131688504): Remove this and use runtime flags for profiler selection.
#ifdef TFLITE_PROFILING_ENABLED
using Profiler = BufferedProfiler;
#else
using Profiler = NoopProfiler;
#endif  // TFLITE_PROFILING_ENABLED
```
I say "circumvent",  because I set the ifdef myself in the code as I didn't know how to pass that flag with a Bazel build invocation. 

(Strictly speaking, the issue is closed, however. The missing profile information applies to all delegates not to xnnpack anymore.) Hi @FabianSchuetze, thanks for the feedback, just FYI you can build it with -DTFLITE_PROFILING_ENABLED, to turn the def on ... I'll work on completing the original intent of that API though.
### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

master branch

### Custom code

No

### OS platform and distribution

Ubuntu 222.04

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

When I run the example label_image in tensorflow lite with profiling enabled (see [here](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/examples/label_image) for the set-up) I get the following output:

```
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
INFO: invoked
INFO: average time: 22.357 ms
INFO:     23.639, Subgraph   0, Node   0, OpCode   3, CONV_2D
INFO:      0.002, Subgraph   0, Node  29, OpCode  43, SQUEEZE
INFO:     22.513, Subgraph   0, Node   0, OpCode   3, CONV_2D
INFO:      0.001, Subgraph   0, Node  29, OpCode  43, SQUEEZE
INFO:     22.354, Subgraph   0, Node   0, OpCode   3, CONV_2D
INFO:      0.001, Subgraph   0, Node  29, OpCode  43, SQUEEZE
```
I would like to get profiling info from XNNPACK. 

I see that the reason is because the program bails out in [xnn_get_runtime_profiling_info](https://github.com/google/XNNPACK/blob/master/src/runtime.c#L742)  because the profiling flags is set to false.  The stack trace is:

```
#0  tflite::xnnpack::(anonymous namespace)::Subgraph::AddEventsToProfiler (
    profiler=0x5555563f54a0, runtime=0x55555631fc90)
    at tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc:1051
#1  0x0000555555b284c1 in tflite::xnnpack::(anonymous namespace)::Subgraph::Invoke (
    this=0x5555563da950, context=0x55555632bd08)
    at tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc:1037
#2  0x0000555555b3a618 in tflite::xnnpack::(anonymous namespace)::SubgraphInvoke (
    context=0x55555632bd08, node=0x5555563325e0)
    at tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc:6192
#3  0x0000555555a5f3f5 in tflite::Subgraph::OpInvoke (this=0x55555632bce0, op_reg=..., 
    node=0x5555563325e0) at tensorflow/lite/core/subgraph.cc:1288
#4  0x0000555555a6046c in tflite::Subgraph::InvokeImpl (this=0x55555632bce0)
    at tensorflow/lite/core/subgraph.cc:1601
#5  0x0000555555a5feea in tflite::Subgraph::Invoke (this=0x55555632bce0)
    at tensorflow/lite/core/subgraph.cc:1494
#6  0x0000555555a2e124 in tflite::impl::Interpreter::Invoke (this=0x55555631d230)
    at tensorflow/lite/core/interpreter.cc:237
#7  0x000055555557393a in tflite::label_image::RunInference (settings=0x7fffffffd8f0, 
    delegate_providers=...) at tensorflow/lite/examples/label_image/label_image.cc:335
#8  0x0000555555574dca in tflite::label_image::Main (argc=11, argv=0x7fffffffdad8)
    at tensorflow/lite/examples/label_image/label_image.cc:558
#9  0x0000555555574e68 in main (argc=11, argv=0x7fffffffdad8)
    at tensorflow/lite/examples/label_image/label_image.cc:566
```
I would like to set the flags to enable profiling, but I am not sure how. Can somebody kindly explain me how to set the flag? 

### Standalone code to reproduce the issue

```shell
See here: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/examples/label_image#build-the-example
```


### Relevant log output

```shell
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
ERROR: failed to get XNNPACK profile information.
```
